How To Check DNS Records Using Basic Nslookup Command Examples

Just type nslookup in you command prompt and you will get your default DNS server and its IP address:

nslookup for default DNS server

  • Nslookup for any web servers IP address

Let’s say I want to know the IP address of Microsoft’s web servers. So just nslookup microsoft.com in you command prompt and you will get the DNS server name and its IP address:

nslookup web servers

In the above screen, you can see that there is a term called Non-authoritative answer. This answer is shown when the reply comes from a source which is not considered authoritative for the domain which it’s returning a record for.
For example, in the above query, the response is coming from my default DNS server which would come as non-authoritative because it is not listed in the list of nameservers for microsoft.com.

  • Different types of Nslookup commands

In the table below, I am going to list out some of the famous Nslookup commands which can be used for different purposes. I will also list out a few examples in the beginning and then I will finally list out those all in a table at the end.
Nslookup example with a parameter:

nslookup set q=a

Let’s understand the above Nslookup query first.
In the above query, the command follows this way:

  • nslookup 
  • > set q=a
  • > fossbytes.com

Now let’s see how to execute by setting different kinds of parameters (the list of which will be given in the table in the end) and do various DNS queries.

nslookup queries
Now if you compare the above image to its previous image, you can see that I have continued setting the different type of DNS queries on the same screen in continuation.
In the following image, I am continuing my different types of queries in the same screen and this time I am querying for Well-Known Service (WKS) for our website fossBytes.com.
wks service nslookup
This query is showing me some more data about fossBytes like primary server name, refresh time, default TTL, mail address etc.
You can also perform many other queries the same way for which I am providing a table below:
Set queries Description
set q=a To know the IP address
set q=any To know all types of data
set q=CNAME To know the Canonical name
set q=MB To know the Mailbox domain name
set q=MX To know about the mail exchange server
set q=SOA To know about the Start-Of-Authority of a DNS Zone
set q=WKS To know about the Well Known service
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s