Edit or Add DNS Name Resolver on CentOS

Issue: Upstream DNS provider fails to resolve some domain names. Troubleshooting confirms the issue is with upstream DNS partners, and not your server.

Solution: Edit the resolv.conf file to use more reliable DNS servers.

nano /etc/resolv.conf

In example below Level 3 nameservers will be used. And the file may be edited to look like the following example:

search your-webserver-domain.com
nameserver 209.244.0.3
nameserver 209.244.0.4
nameserver 4.2.2.1
nameserver 4.2.2.2

Save the file. To test, ping one of the domain names that were previously not reachable (from your server):

ping -c 4 domainname.com

3 thoughts on “Edit or Add DNS Name Resolver on CentOS”

  1. The free DNS servers listed as Level3 will automatically route to the nearest DNS server operated by Level3 Communications, the company that provides most of the ISPs in the US their access to the internet backbone. Alternatives include 4.2.2.1, 4.2.2.2, 4.2.2.3, 4.2.2.4, 4.2.2.5, and 4.2.2.6. These servers are often given as Verizon DNS servers but that is not technically the case (they are Level 3 nameservers).

    Reply

Leave a comment

BlogLogistics