shell

Are your DNS Servers failing?

Some days ago Google launched its public DNS service. Another older, public DNS service is OpenDNS. Both let you use their DNS servers insted of your ISP’s.

I have been using OpenDNS for a year because I had problems with my ISP’s DNS servers. They were down frequently, so I searched for a reliable alternative. There are some ways to know if your service provider’s DNS servers are working properly.

You can use nslookup, which is a program to query Internet domain name servers.

$ nslookup google.com
Server:         208.67.222.222
Address:        208.67.222.222#53

Non-authoritative answer:
Name:   google.com
Address: 66.102.9.103
Name:   google.com
Address: 66.102.9.105
Name:   google.com
Address: 66.102.9.99
Name:   google.com
Address: 66.102.9.104
Name:   google.com
Address: 66.102.9.147

The host command is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa.

$ host google.com
google.com has address 66.102.9.105
google.com has address 66.102.9.147
google.com has address 66.102.9.104
google.com has address 66.102.9.103
google.com has address 66.102.9.99
google.com mail is handled by 10 google.com.s9b2.psmtp.com.
google.com mail is handled by 10 google.com.s9a2.psmtp.com.
google.com mail is handled by 10 google.com.s9b1.psmtp.com.
google.com mail is handled by 10 google.com.s9a1.psmtp.com.

And finally, the dig command (domain information groper) is a flexible tool for querying DNS name servers. It performs DNS lookups and displays the answers returned from the queried name server(s). Most DNS administrators use dig to troubleshoot DNS problems because of its flexibility, ease of use and clarity of output.

$ dig google.com

; <<>> DiG 9.4.3-P3 <<>> google.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62217
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             141     IN      A       66.102.9.103
google.com.             141     IN      A       66.102.9.104
google.com.             141     IN      A       66.102.9.105
google.com.             141     IN      A       66.102.9.147
google.com.             141     IN      A       66.102.9.99

;; Query time: 223 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Mon Dec 14 18:49:21 2009
;; MSG SIZE  rcvd: 108

if one of these command does not return an IP address as a result, then the DNS servers are not working. Usually this can be tested with $?==0: if true, the command returned a valid IP address, otherwise there was a problem.

3 Comments

  • On 12.18.09 Marcos said:

    Another really cool (as it is Google’s) alternative is Google Public DNS

  • On 12.18.09 rafacas said:

    I have started the post talking about it ;)

  • On 12.20.09 Marcos said:

    I am absolutely sure that you have added the first sentence of the post after reading my comment!! :-P

    Or I might suffer from first-sentence-ADHD … another disorder to my list …

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*Required Fields