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
$ tar xvfvz namebench-1.3.1-source.tgz
$ cd namebench-1.3.1
$ ./

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

$ sudo yum install tkinter
$ wget
$ tar xvfvz namebench-1.3.1-source.tgz
$ cd namebench-1.3.1
$ ./

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  # OpenDNS  
nameserver    # Verizon Home5 US  
nameserver     # SYS-  

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.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

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. 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:

    • 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, 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 " 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 *