How to Know When Your DNS Servers Are Failing

December 6, 2009

Now that both Google Public DNS and OpenDNS offer an alternative, public DNS services anyone can opt to use instead of their service provider's DNS servers, the question is: how do you know if your DNS service isn't working properly and if you should switch? Reader Nicholas has the answer. He says:

The easiest way to determine if your chosen DNS servers are down, you can use nslookup or dig command line tools. Open a command line prompt (Select “Start > Run” and type “cmd” on a Windows machine, “Applications > Utilities > Terminal” on the Mac) and type:

If an IP address comes back and the web page appears to be loading properly in your browser, your DNS servers are working fine. If no address comes back, or an unexpected web page appears despite a successful dig, there is a problem. “dig” is the newer and recommended tool, but both should work fine for basic troubleshooting purposes.

A few months back I knew my DNS servers were screwy when I couldn't load certain web sites, but said those sites were up. At that point I switched my DNS service to OpenDNS and that solved the problem. Here's more on how to troubleshoot a flaky internet connection. Thanks, Nicholas!

Update: If you just want to see what DNS servers are fastest, benchmark your options with Namebench.

Then you can use namebench to compare speeds of different DNS servers.

Editor: Fixed the Namebench link in this comment.

Vince Lund
Dec 6 09 at 10:34 am

Er, I don’t know about Mac (and I don’t have a Windows box to try this on), but I’m pretty sure “dig” and “nslookup” will treat the “http://” as part of the hostname.

I believe “nslookup” is deprecated on Linux distributions, with “host” as the preferred DNS query tool, e.g., “host“.

Note that with “host”, you can specify the DNS server to query by putting it at the end of the statement, e.g., “host″. You can compare the results from different DNS servers if you want. “nslookup” and “dig” will have similar options to query specific servers.

Cheng-Jih Chen is correct. You’ll want to leave out the ‘http://’ on those commands. If you’re using OpenDNS, they’ll still pull up an IP with the http://, but that’s only because OpenDNS resolves everything to its own IP if it can’t find the server.

Otherwise though, it’s a great suggestion to show people how to determine if this is their problem or not. Using an alternate DNS has many times saved the day when my ISP has had trouble.

Jimmy Blake [+12]
Dec 6 09 at 12:05 pm

Thanks y’all–just removed the http:// from the commands in this post.

Gina Trapani [+195]
Dec 6 09 at 3:37 pm

Comments are closed. Thanks for reading!