Home 0P3N Blog Using Nslookup in Windows to Check DNS Records
Ready to Start Your Career?
Create Free Account
By: Alfrick Opidi
June 2, 2016

Using Nslookup in Windows to Check DNS Records

By: Alfrick Opidi
June 2, 2016
By: Alfrick Opidi
June 2, 2016
magnifying-glass-cybraryNslookup, meaning "name server lookup," is a popular built-in command tool that comes with most versions of the Windows operating system. It's a handy tool you can use to diagnose the DNS infrastructure of the requested domain name.By default, the Nslookup command translates word-based domain names to numerical IP addresses (and vice versa).Other more powerful variants of Nslookup can be used to get information concerning the mail exchange server, FQDN, DNS server responsiveness, DNS configuration, etc. You can effectively check the status of your DNS records and rectify any issues relating to a particular service.For example, if your domain isn't able to receive emails well due to problems with your DNS server, you may use the Nslookup command to confirm the domain has a valid MX record and ascertain that that MX record is pointed to the correct email address.Nslookup can be operated in the command prompt on Windows to give the desired results.
Here are examples using basic Nslookup commands for checking the health of DNS records. nslookup-1To know your default DNS server and IP address:Typing Nslookup in your Windows command prompt will give details of your default DNS server and its associated IP address. To know IP address of any web server:For example, to query the IP address of Cybrary's web server, just type nslookup cybrary.it in your command prompt. The outcome will give the DNS server name and its associated IP addresses, as illustrated below:exe-2

Here, 41.203.208.18 is the default system domain name server used to query the external server. Thereafter, there are the lookup details for Cybrary.it. The name server query gave two entries, 104.20.36.13 and 104.20.37.13, indicating that Cybrary.it distributes its server load on different servers.

Notice that the query produced a "Non-authoritative answer." This indicates that the results come from a server that isn't the root source for those records. To get an authoritative answer, the primary name server needs to be specified beforehand.

 Different types of Nslookup variants:There are a number of commonly used Nslookup commands, which are used for achieving various objectives. A full list of the most commonly used commands is provided at the end of this article. Here's the generic syntax for using Nslookup with a parameter:
  • nslookup <Press Enter>
  • (Set parameter option) <Press Enter>
  • (Enter domain name) <Press Enter>

Let's see how it can be used with different types of parameters to perform various DNS queries:

Example 1

To lookup for the domain IP address, use the set q=a option query

nslookup-3

Notice the answer is the same as that of the earlier query we performed.

Example 2

To lookup all types of data, use the set q=any option query

nslookup-4

This query gives the entire domain records of Cybrary.it, such as mail exchange records, primary server name, refresh time, etc.

You can also check other types of DNS records using the same methods illustrated above.

 Here's a list of the various Nslookup command queries: 
Set QueriesMeaning
set q=aTo lookup for the IP address of a domain name
set q=MXTo find more information about the mail exchange server
set q=SOATo check records of Start-of-Authority of a DNS Zone
set q=anyTo lookup for all types of data
set q=MBTo lookup for the Mailbox domain name
set q=WKSTo find more information about the Well-Known Service
set q=CNAMETo lookup for the Canonical name
 Any questions or comments? Please use the comment section below.The above article was authored by Alfrick Opidi of Legitblogger.com
Request Demo

Build your Cybersecurity or IT Career

Accelerate in your role, earn new certifications, and develop cutting-edge skills using the fastest growing catalog in the industry