howtouselinux

2 Ways to Check DNS Speed

Table of Contents

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.

Test DNS Speed with nslookup command

The best way to test DNS speed is using nslookup command. It performs a name resolution against a DNS server. This command is available on Linux and Windows systems.  It can display the time it takes for the name resolution with Windows’ powershell.

powershell “Measure-Command { nslookup www.google.com }”
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

If we need to specify the DNS server like 8.8.8.8, we can use this command powershell “Measure-Command { nslookup www.google.com 8.8.8.8 }”

On Linux, we can run this command time nslookup www.google.com get the DNS resolution time.

time nslookup www.google.com
Server: 64.104.76.247
Address: 64.104.76.247#53
Non-authoritative answer:
Name: www.google.com
Address: 142.250.4.147
Name: www.google.com
Address: 142.250.4.106
nslookup www.google.com  0.00s user 0.03s system 5% cpu 0.571 total

Which DNS Server is good?

We recommend using ExpressVPN to get a better speed. The dedicated DNS servers can offer you fast DNS speeds and robust security. With over 5422 servers in 60 countries, you can always find a server that’s close to your streaming platforms or gaming servers.

When you use ExpressVPN, your DNS requests are handled directly by ExpressVPN, with no exposure to third parties. You don’t need to opt in to use ExpressVPN’s private DNS. The ExpressVPN app protects all DNS requests automatically, with the same encryption and tunneling protocols as all your other online activity.

ExpressVPN is the perfect tool to improve your online experience. With ExpressVPN, you can stream and download your favorite content with unlimited bandwidth. You can access your favorite apps securely anywhere—even on public Wi-Fi. Plus, you can be sure that your data is always safe and secure.

So if you want to take your online experience to the next level, look no further than ExpressVPN. Plus, they have a 30-day money-back guarantee and 3 months free, so you can try them out risk-free.

Check out ExpressVPN here

 

Test DNS Speed 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 example.com domain using an OpenDNS server (which has IP address 208.67.222.222):
dig @208.67.222.222 example.com

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 example.com domain, type the following command:

dig example.com 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 example.com currently points to IP address 93.184.216.119.

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

;; QUESTION SECTION:
;example.com. IN A

;; ANSWER SECTION:
example.com. 2424 IN A 93.184.216.119

;; Query time: 12 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu Jan 9 16:07:09 2014
;; MSG SIZE rcvd: 45

$ dig @8.8.8.8 www.howtouselinux.com | grep “Query time:”
;; Query time: 15 msec
$ dig @4.2.2.1 www.howtouselinux.com | grep “Query time:”
;; Query time: 289 msec

 

How to use nslookup?

The nslookup command is a network diagnostic tool that allows users to query the Domain Name System (DNS) for information about internet hosts. The nslookup command can be used to perform the following tasks:

  • Resolve domain names to IP addresses
  • Retrieve MX records for a domain
  • Retrieve the name servers for a domain

Nslookup is a command-line tool that is available on most operating systems.

To use nslookup, open a command prompt and type nslookup followed by the domain name you want to look up. For example, to find the IP address for www.example.com, you would type: nslookup www.example.com

The tool will then query the DNS server to retrieve that domain’s IP address, along with any other relevant information about the domain. This can be very useful for troubleshooting networking issues or identifying potentially malicious activity on your network. Additionally, you can use nslookup to find the name servers for a domain, or to retrieve any other information that is stored in the DNS database.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

If you meet any issues with Linux, record them with Loom and send the link to us here. We will reply ASAP.

Load WordPress Sites in as fast as 37ms!