Issue Description
The Linux instances cannot resolve domain name such as mirrors.tencentyun.com and mirror.ccs.tencentyun.com, and so on.
Possible Causes
DNS address is not configured or is configured incorrectly.
Firewall is configured with rules for port 53.
NSCD caching service for DNS is enabled.
The /lib64/libnss_dns.so.2 library file is missing, causing domain name resolution failure.
Solution
Follow the methods below to troubleshoot and locate the issue, and then choose the appropriate solution based on the actual situation:
1. Run the following command to check whether the DNS server is configured correctly.
cat /etc/resolv.conf
cat /run/systemd/resolve/resolv.conf
Tencent Cloud's DNS server:
nameserver 183.60.82.98
nameserver 183.60.83.19
2. Run the following command to check if the firewall has added the rules for port 53.
If the firewall settings include the rules for port 53, disable the firewall or delete the rules. For more information on using the firewall, see Firewall. 3. Run the following command to check if the NSCD caching service for DNS is enabled.
If the NSCD caching service is enabled, run the command systemctl stop nscd
to disable the NSCD caching service.
4. Check if key library files such as /lib64/libnss_dns.so.2 are missing or modified.
ls -l /lib64/libnss_dns.so.2
rpm -V glibc
Check if the source file for the symbolic link exists, such as /usr/lib64/libnss_dns-2.17.so for CentOS 7. If it does not exist, you can download and replace it with the same version of OS downloaded from a normal server.
If /usr/lib64/libnss_dns-2.17.so still exists, you can fix it with a symbolic link.
ln -s /usr/lib64/libnss_dns-2.17.so /usr/lib64/libnss_dns.so.2
Was this page helpful?