I am using google open DNS. How can I measure the speed of a DNS server?
If you just want to time the lookup of a single record, use
time dig a foobar.com @184.108.40.206. This testing method really isn't that good since after the first lookup, you'll be getting cached results and whatever server is closer to you will give you the fastest response.
namebench is probably the tool you're looking for. It does lookups based on domains are in your browser cache, random records from a list of popular records, etc. It is highly configurable to test your preferred list of DNS servers, your list of records, etc.
This helped me on the bash prompt. I had an issue where the name servers were randomly timing out. You need the dig utility, which is not a default on minimal installs. You can get it by installing
$ yum install bind-utils
for Fedora/RedHat/CentOS or
$ apt install dnsutils
$ while true; do dig www.google.com | grep time; sleep 2; done
This yields an output like:
;; Query time: 2 msec ;; Query time: 1 msec ;; connection timed out; no servers could be reached ;; Query time: 1 msec ;; Query time: 53 msec ;; connection timed out; no servers could be reached ;; connection timed out; no servers could be reached ;; Query time: 2 msec ;; Query time: 5 msec ;; Query time: 3 msec
On a healthy connection, it should be no more than 2 msec a query.
sudo apt-get install namebench
brew install namebench
namebench ... > Sending 1 queries to 7 servers... [0/7] > Sending 1 queries to 7 servers... [4/7] > Sending 1 queries to 7 servers... [6/7] > Sending 1 queries to 7 servers... [7/7] > Saving report to /tmp/namebench_2019-08-13_1148.html > Saving detailed results to /tmp/namebench_2019-08-13_1148.csv > Opening /tmp/namebench_2019-08-13_1148.html > Complete! SYS-127.0.0.53 [127.0.0.53] is the best. Au revoir, mes amis!
Namebench will make an html report with the results of the best DNS for you based on response speed of the DNS server.
dnsperf and resperf are free tools developed by Nominum/Akamai (2006-2018) and DNS-OARC (since 2019) that make it simple to gather accurate latency and throughput metrics for Domain Name Service (DNS). These tools are easy-to-use and simulate typical Internet, so network operators can benchmark their naming and addressing infrastructure and plan for upgrades. The latest version of the dnsperf and resperf can be used with test files that include IPv6 queries.
Building from Git repository
git clone https://github.com/DNS-OARC/dnsperf.git cd dnsperf ./autogen.sh ./configure [options] make make install
The binary file will be complied in
simple config file
and the name of it is data
run the test
-d data is for config file (see above)
./src/dnsperf -s 220.127.116.11 -d data -c 10 -l 10 -Q 100
and this means
-ssource IP address == DNS server to query from
-dread record from this file
-cnumber of clients
-lfor this duration of time (10 seconds)
-Qsend this number of query
here 10 clients + 100 queries => 1000 requests
Statistics: Queries sent: 1000 Queries completed: 1000 (100.00%) Queries lost: 0 (0.00%) Response codes: NOERROR 1000 (100.00%) Average packet size: request 34, response 87 Run time (s): 10.075874 Queries per second: 99.246974 Average Latency (s): 0.083850 (min 0.080296, max 0.091041) Latency StdDev (s): 0.001694
DNS Measurement, Troubleshooting and Security Auditing Toolset
Ever been wondering if your ISP is hijacking your DNS traffic? Ever observed any misbehavior with your DNS responses? Ever been redirected to wrong address and suspected something is wrong with your DNS? Here we have a set of tools to perform basic audits on your DNS requests and responses to make sure your DNS is working as you expect.
use via Docker
docker run -it --rm farrokhi/dnsdiag /bin/bash
./dnseval.py -t A -f public-servers.txt -c10 shakiba.net
-ttype of query e.g.
-fread config file
-cnumber of query
the file public-servers.txt contains list of DNS server to query from e.g.
#Cloudflare 18.104.22.168 22.214.171.124
sample test + output
./dnseval.py -t A -f public-servers.txt -c10 shakiba.net server avg(ms) min(ms) max(ms) stddev(ms) lost(%) ttl flags response --------------------------------------------------------------------------------------------------------------- 126.96.36.199 7.301 6.502 11.736 1.566 %0 298 QR -- -- RD RA -- -- NOERROR 188.8.131.52 6.816 6.195 8.433 0.622 %0 297 QR -- -- RD RA -- -- NOERROR
Several of the above answers mention
namebench. Despite being a useful tool, it is currently unmaintained.
It's successor is naminator, and unlike
namebench, it is currently under active development. You may want to check it out.