Skip to Content

2 Ways to Check DNS server response time

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 our computer could be automatically selected by our service provider or hard-coded.

A fast DNS server is one of the essential elements to a faster browsing experience.

Check DNS server response time with Dig command

The command dig is a tool for querying DNS nameservers for information about host addresses, mail exchanges, nameservers, and related information. This tool can be used from any Linux (Unix) or Macintosh OS X operating system. The most typical use of dig is to simply query a single host.

To use a specific DNS server for the query, use the @ option. For example, the following dig command performs a DNS lookup on the domain using an OpenDNS server (which has IP address
dig @

By default, dig displays the A record for a domain. To look up a different DNS record, add it to the end of the command. For example, to look up the MX (mail exchanger) record for the domain, type the following command:

dig MX

Query time shows how long it took to get the DNS response back from the server, which is listed on the next line.

Dig displays a QUESTION SECTION (the request) and an ANSWER SECTION (what the DNS server sends in response to the request). In this case, we used the default options for dig, which simply looks up the A record for a domain. From this, we can see that currently points to IP address

user@localhost:~$ dig
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46803
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

; IN A


;; Query time: 12 msec
;; WHEN: Thu Jan 9 16:07:09 2014
;; MSG SIZE rcvd: 45

$ dig @ | grep “Query time:”
;; Query time: 15 msec
$ dig @ | grep “Query time:”
;; Query time: 289 msec

Check DNS server response time with nslookup command

nslookup performs a name resolution against a DNS server – so this is the right command to use. But it does not display the time it takes for the name resolution. It’s possible to do that with Windows’ own powershell:

powershell “Measure-Command { nslookup }”
Now, this outputs on my system.

Non-authoritative answer:

Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 31
Ticks : 317898
TotalDays : 3,679375E-07
TotalHours : 8,8305E-06
TotalMinutes : 0,00052983
TotalSeconds : 0,0317898
TotalMilliseconds : 31,7898

On Linux, we can run this command time nslookup