As you may know DNS is a system by which a browser or other software converts a domain name to a IP4 or IP6 address. Each time we access a website the browser needs to convert the domain name to a IP4/IP6 address using a DNS server. The DNS server configured on your computer could be automatically selected by your service provider or hard-coded. A fast DNS server is one of the essential elements to a faster browsing experience.
There are many DNS servers, and each of them provide varying responsive times for DNS resolution. Here is a list of free and public DNS servers that you can use.
Checking for DNS server speeds using Dig
As said before a fast DNS server enhances your browsing experience. You can check the response time of a particular DNS server using the Linux ‘dig’ command. Dig (domain information groper) is a Linux tool that is used for querying DNS servers making it very useful for troubleshooting DNS problems. You run a simple dig command as below, which uses the default DNS server configured on your server. Here we are asking dig to query ‘wordpress.org’.
$ dig wordpress.org ; <<>> DiG 9.10.3-P4-Ubuntu <<>> wordpress.org ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27986 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1280 ;; QUESTION SECTION: ;wordpress.org. IN A ;; ANSWER SECTION: wordpress.org. 0 IN A 188.8.131.52 ;; Query time: 46 msec ;; SERVER: 127.0.1.1#53(127.0.1.1) ;; WHEN: Tue Aug 07 08:23:06 IST 2018 ;; MSG SIZE rcvd: 58
The essential thing to check is the 'Query time' line, which for the above gives '46 msec'. This is the time required to resolve the domain name 'wordpress.org' to its IP address '184.108.40.206'. The lesser this number the better - this means the DNS server is able to do the necessary conversion and return the result in a short time. Run the command a few times to get a average of the query time.
To use another DNS server than the default one on your computer you can specify that with the @ symbol, followed by the hostname or IP address of the name server. An example below shows how to check the speed of the DNS server '220.127.116.11.' (Cloudflare). The command with the resulting output is show below. As mentioned above, run dig a few times to get an average reading.
$ dig @18.104.22.168 wordpress.org ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @22.214.171.124 wordpress.org ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14396 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1452 ;; QUESTION SECTION: ;wordpress.org. IN A ;; ANSWER SECTION: wordpress.org. 109 IN A 126.96.36.199 ;; Query time: 61 msec ;; SERVER: 188.8.131.52#53(184.108.40.206) ;; WHEN: Tue Aug 07 08:14:23 IST 2018 ;; MSG SIZE rcvd: 58
You can shorten the output to the essentials by using additional options.
$ dig @220.127.116.11 wordpress.org +noall +stats ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @18.104.22.168 wordpress.org +noall +stats ; (1 server found) ;; global options: +cmd ;; Query time: 96 msec ;; SERVER: 22.214.171.124#53(126.96.36.199) ;; WHEN: Tue Aug 07 08:28:18 IST 2018 ;; MSG SIZE rcvd: 58
For Windows you can download the dig tool from the isc.org website.
Using a desktop tool
If you are more comfortable using a desktop application than you can use Gibson Research's DNS Benchmark desktop utility to check for various DNS server performance metrics.
DNS Benchmark performs a detailed analysis and comparison of the operational performance and reliability of any set of up to 200 DNS nameservers at once.
NOTE: While running speed tests using dig or other tools ensure that no other applications are using the network (like youtube or some background downloading) as this can distort the final results.