How to test DNS server speed on Linux

Without manual configuration, your Linux will be set to use the DNS service offered by your ISP or organization. If you are not satisfied with the default DNS service, you can consider using other public DNS services such as Google DNS, OpenDNS, etc. Before switching to different DNS servers, you probably want to compare DNS server speed among available DNS servers, and find the best DNS for you.

On Linux, there is an open-source DNS benchmark tool called namebench which can help you find the best DNS servers to use. namebench can run in command-line mode as well as in GUI mode. In this post, I will describe how to test and compare DNS server speed by using namebench.

To install and launch namebench on Debian, Ubuntu or Linux Mint:

$ sudo apt-get install python-tk
$ wget http://namebench.googlecode.com/files/namebench-1.3.1-source.tgz
$ tar xvfvz namebench-1.3.1-source.tgz
$ cd namebench-1.3.1
$ ./namebench.py

To install and launch namebench on CentOS, RHEL or Fedora:

$ sudo yum install tkinter
$ wget http://namebench.googlecode.com/files/namebench-1.3.1-source.tgz
$ tar xvfvz namebench-1.3.1-source.tgz
$ cd namebench-1.3.1
$ ./namebench.py

If you don't have X11 installed, namebench will automatically proceed in command-line mode, and start evaluating available DNS servers right away. If you have X11 installed, namebench will launch a graphical interface as follows. Click on "Start Benchmark" button to start DNS benchmarking. namebench will test your local DNS servers, as well as public and regional DNS servers.

When run in command-line mode, namebench will, upon completion, prints out benchmarking summary (e.g., recommended DNS configuration) in the terminal as follows.

Recommended configuration (fastest + nearest):
----------------------------------------------
nameserver 208.67.220.220  # OpenDNS  
nameserver 151.198.0.39    # Verizon Home5 US  
nameserver 71.250.0.12     # SYS-71.250.0.12  

********************************************************************************
In this test, OpenDNS is 5.1%: Faster 
********************************************************************************

- Saving report to /tmp/namebench_2013-04-30_2337.html
- Saving detailed results to /tmp/namebench_2013-04-30_2337.csv

When run in GUI mode, namebench will show DNS speed test result in a web browser window. A typical DNS benchmarking report generated by namebench looks like the following.

DNS speed comparison summary:

Mean/minimum DNS response time:

DNS response time distribution:

To compare DNS servers, namebench performs DNS lookup on hostnames found in your web browser history, or Alexa top 10,000 domain names. DNS lookup time measurements generated by namebench are stored in /tmp/namebench_*.csv, so you can do any custom analysis if you want.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

5 thoughts on “How to test DNS server speed on Linux

  1. Performance is just one aspect of a good DNS server; you will also want to test availability (whether it is reachable and functioning 99.99% of the time), reliability (whether it returns information as-is, or does it do funky stuff when the domain is NXDOMAIN, or maybe it purposefully disregard a domain's TTL), scalability (does it properly do caching), and security.

    GRC.com provides a small, graphical, freeware utility to 'score' DNS servers based on the above factor. It's written in assembly, so it's standalone, and runs well on Windows and Wine. Just go here for the lowdown: https://www.grc.com/dns/benchmark.htm

    • Good point. Agree that availability/reliability are other factors to look at.

      GRC looks good. Written in assembly? It's been a while since I saw something written in assembly...

      • Well... Steve Gibson, the guy behind grc.com, is quite known in my days as a brilliant -- if 'slighly' eccentric -- guy... ;-)

  2. Namebench is dead and the dns cache is outdated, so you will get warnings like "paypal.com is hijacked". Regardless, it still is useful. Hope development gets picked up.

Leave a comment

Your email address will not be published. Required fields are marked *

Current day month ye@r *