tencent cloud

Feedback

Domain Name Resolution Failure (Linux System)

Last updated: 2024-12-23 16:07:43

    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 #(tlinux/redhat/centos/rockylinux)
    cat /run/systemd/resolve/resolv.conf #(ubuntu)
    If the DNS server is not configured correctly, modify the DNS server address. It is recommended to refer to the document customizing DNS configuration in Linux instances.
    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.
    iptables -L
    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.
    systemctl status nscd
    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
    # The /lib64/libnss_dns.so.2 library file is generated by the glibc package, and you can check if the package has been modified by verifying glibc.
    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
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support