Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm considering Google's public DNS servers as the external DNS for my network. Currently I'm using the DNS servers from my ISP. I've also considered OpenDNS in the past, but ultimately decided not to jump.

I'd like to be able to benchmark how quickly the respective servers are able to serve our DNS requests. I see nothing in nslookup that would help.

How can I test the round-trip times for externally provided DNS?

share|improve this question

9 Answers 9

up vote 5 down vote accepted

You can use a packet capture program (filtering for DNS) to track the DNS query\response times. You can run this on your machine or on your internal DNS server (if you have one). All things being more or less equal, this should give you a general idea of how quickly Google DNS is compared to your ISP.

share|improve this answer
2  
Wireshark's DNS dissector does request/response tracking. The "dns.time" display filter can be used to find the response time. –  Gerald Combs Dec 14 '09 at 16:28
    
@Gerald: Thanks for the info. –  joeqwerty Dec 14 '09 at 17:11

dig @8.8.8.8 www.rimuhosting.com | grep "Query time:"

;; Query time: 15 msec

dig @4.2.2.1 www.rimuhosting.com | grep "Query time:"

;; Query time: 289 msec

share|improve this answer

Use GRC's Domain Name Speed Benchmark.

share|improve this answer
    
I checked out this tool... it rocks! –  Mike L Dec 4 '09 at 19:08
    
I tried GRC's Benchmark after running Google's namebench. Google's said it's own 8.8.4.4 was 21.1% faster than other's. However GRC's customized list w/added 8.8.4.4 showed google's was one of the slowest and only marginally faster than my current DNS provided by Comcast. The fastest were all from Level 3 Communications. I trust GRC's DNS Benchmark over Google's now. And GRC's is written in assembly and runs from a single 184k file. Impressive! –  Brian Boatright Feb 9 '12 at 4:58

I also took a look at namebench - Google's Open Source DNS Benchmark Utility. It was very comprehensive.

share|improve this answer

I have done some basic benchmarks between OpenDNS and GoogleDNS. The results suggest that the OpenDNS offering is consistently faster than Google's DNS service:

http://ajclark.wordpress.com/2009/12/04/google-dns-vs-opendns-performance-comparison/

share|improve this answer

Firebug plugin for Firefox and IE has a "net" tab that gives you a graphical representation of load time for every file request.

It breaks it down into activity including DNS lookups, which are shown in green.

share|improve this answer

The simple shell script qtest.sh can be used for that:

% qtest -n3 "A a.gtld-servers.net" 172.19.1.1 62.4.16.70 62.4.17.69 208.67.222.222 208.67.220.220 156.154.70.1 156.154.71.1  
3 172.19.1.1/172.19.1.1
49 62.4.17.69/62.4.17.69
61 208.67.222.222/208.67.222.222

Here, 172.19.1.1, a local resolver, is faster, followed by the ISP resolver, then OpenDNS.

share|improve this answer
    
+1 useful script –  mezgani Dec 17 '09 at 11:43

You can use ping to figure out how long it would take for a packet to move back and forth between your server and the DNS servers. As a general rule: never change what works.

A disadvantage to OpenDNS is that domains that do not exist may respond with an A record pointing to OpenDNS's search page, as they tend to do that. Google doesn't currently do it, but it would be foolish to assume they are simply providing DNS resolvers with nothing to gain from it.

share|improve this answer
    
If I could have split an answer, I would have. I liked the ping test for it's simplicity. I could let it run against all of them, then look at the averages. Here, I wanted to look at the response times for the query itself in addition to the round trip for the packets, so I opted for the packet capture. More work to set it up and test, but more exacting for the true performance of the external server. Thanks! –  Mike L Dec 4 '09 at 16:39
1  
Bad idea to use ping. Not all servers respond to ping and there is zero guarantee that the response time will be the same with DNS and with ICMP. –  bortzmeyer Dec 17 '09 at 11:30

I wrote little nice script to evaluate connection to DNS servers:

cat >test_dns_list_speed.sh
#!/usr/bin/env ksh
site="www.google.com"
IPfile="$1"
samples=$2

if [ ! -f "$IPfile" ] || ! echo "$samples"|egrep -q "[0-9]+" ; then
  echo "test_dns_list_speed.sh <file-ip-list> <samples>"
  echo "<file-ip-list>       newline separated list of DNS server IP adresses"
  echo "<samples>            how many DNS resolution samples to take"
  echo "PURPOSE:"
  echo "          collect statistics about response times from list of DNS servers"
  exit 1
fi

typeset -i i

while [ $i -lt $samples ]; do
  i=$i+1
  for IP in `cat $IPfile`; do
    time=`dig @$IP $site| awk '/Query time:/ {print " "$4}'`
    IPtrans=`echo $IP|tr \. _`
    eval `echo result$IPtrans=\"\\$result$IPtrans$time\"`
  done
done

for IP in `cat $IPfile`; do
  IPtrans=`echo $IP|tr \. _`
  printf "%-15s " "$IP"; echo -e `eval "echo \\$result$IPtrans"`|tr ' ' "\n"|awk '/.+/ {rt=$1; rec=rec+1; total=total+rt; if (minn>rt || minn==0) {minn=rt}; if (maxx<rt) {maxx=rt}; }
             END{ if (rec==0) {ave=0} else {ave=total/rec}; printf "average %5i     min %5i     max %5i ms %2i responses\n", ave,minn,maxx,rec}'
done

./test_dns_list_speed server_list 20
202.93.142.10   average   949     min   523     max  2229 ms 20 responses
202.93.142.20   average   897     min   515     max  2017 ms 20 responses
208.67.222.222  average  1235     min   530     max  3362 ms 20 responses
8.8.8.8         average   759     min   529     max  1624 ms 20 responses
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.