Troubleshooting DNS issues

DNS issues are typically rare, except in the case of an invalid configuration. In most cases, any troubleshooting you do would be done on your local DNS servers, as public DNS servers on the Internet are outside of your control. In the case of an external DNS server failing, such as that from your ISP, your only recourse might be to use a different DNS provider, such as utilizing Google's public DNS addresses of 8.8.8.8 and 8.8.4.4. But in the case of your local DNS server failing, you have more control.

As always, you would start troubleshooting DNS issues by checking whether or not you can reach the DNS server. First, check /etc/resolv.conf to see which DNS server your machine is using. Is it the correct server? If not, correct this in your network scripts and restart networking. If it is the correct server, can you reach it? Try a simple ping, and as long as the server is configured to respond to ICMP echo requests, you should see a response. If you can reach the server, SSH into it and check its logs. Perhaps the daemon (bind in Debian, and named in CentOS) isn't running.

Moving beyond the simple things, there is a specific utility we can use to help troubleshoot bind-specific issues, and that utility is nslookup. Use the nslookup command along with the name of the resource you're trying to find, such as a hostname or the URL of a website.

Troubleshooting DNS issues

The output of a working DHCP server

The output of nslookup tells us a few useful things we can use to troubleshoot further. First, it will give us the IP address of the server that answered our request. In my case, 10.10.96.1 answered via port 53. Then, I can see the result of my query for packtpub.com, which gave me an external IP address of 83.166.169.231. So far, so good. If your DNS server is reachable, the daemon is running and your local workstation is configured to point to it, a very common gotcha is the serial number in your domain record. If you've added a resource to your DNS server but forgot to increment the serial number, that can cause a lookup to fail even though you did add the configuration for that host. This may seem like common knowledge, but you'd be surprised how easy it is to forget.

In the event that nslookup doesn't return a record, check that you have actually added that record to the server. If it does respond with a record, then everything should be running smoothly as long as you have configured your local workstation to point to the correct server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset