Using Nslookup in Windows to Check DNS Records
Here are examples using basic Nslookup commands for checking the health of DNS records. To 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:
Here, 184.108.40.206 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, 220.127.116.11 and 18.104.22.168, 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:
To lookup for the domain IP address, use the set q=a option query
Notice the answer is the same as that of the earlier query we performed.
To lookup all types of data, use the set q=any option query
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 q=a||To lookup for the IP address of a domain name|
|set q=MX||To find more information about the mail exchange server|
|set q=SOA||To check records of Start-of-Authority of a DNS Zone|
|set q=any||To lookup for all types of data|
|set q=MB||To lookup for the Mailbox domain name|
|set q=WKS||To find more information about the Well-Known Service|
|set q=CNAME||To lookup for the Canonical name|