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

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,,,,, and These servers are often given as Verizon DNS servers but that is not technically the case (they are Level 3 nameservers).


Leave a comment