How to test DNS with nslookup

Follow

When working with websites, a lot of the time you will need to have control over your DNS.
DNS makes use of a performance enhancement called caching. This caching is great for regular use, but can be a pain if you need to bypass it.

There is a tool to test DNS that is built-in to both Windows and Mac systems called nslookup
nslookup is incredibly useful to help troubleshoot DNS problems. Here is how you access the tool:

Open up a command prompt
You can open command prompt by typing cmd in the start search box or by holding the Windows key + press 'R', type cmd and enter

Enter nslookup ?

This is the syntax for the command:

nslookup -option query server

Where:
-option= what record you want to ask for?
query= what domain are you asking about?
server= what server are you going to ask?

If you leave out the option and server, the default is to ask the default gateway for the A record.

Above is a default nslookup. Notice that the server/address is the default gateway and the answer is the a record

Now that we understand how nslookup works, lets ask a targeted, specific question about a domain:

Above is a specific query about the domain sony.com. The query is asking "what are the NS (name servers) of sony.com?". The question is being directed to Google server (8.8.8.8).

The response back is from the Google server and it's answered that the NS for sony.com is pdns1.cscdns.net and pdns2.cscdns.net.

 If you ever wonder "why can I see the website but my customer can't?" or "why are they seeing the old site?". Do some testing with nslookup and see what other servers are seeing.

Have more questions? Submit a request

Comments

Powered by Zendesk