How to test DNS server speed on Linux

Last updated on December 20, 2020 by Dan Nanni

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.

Install namebench on Linux

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

$ sudo apt-get install python-tk
$ wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/namebench/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 running namebench in a Linux desktop environment, 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.

Sample DNS Speed Test Results by namebench

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.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean