×
nslookup to check dns records

In the internet world, computers & devices always identify each other with a unique identification number called an IP address.

DNS stands for Domain Name System and computers use this to translate domain names to their IP addresses so that browsers can load the requested website.

When DNS stops working, you cannot access websites or send any emails.

If this is the case, you will need to troubleshoot and fix the DNS issues in order to access the website.

NSLookup

Nslookup stands for “name server lookup” and it is a command-line tool used to troubleshoot and verify DNS servers and records, and fix the name server related problems.

With Nslookup, you can find the IP address of any website by its name and also find the detailed information of the various DNS records of the specific domain name.

In this guide, we will show you how to use Nslookup to check DNS records with examples.

Basic Syntax of Nslookup

By default, Nslookup is installed in most Windows based operating systems.

To find all the options available with the Nslookup command, run the nslookup command hit Enter then type ? and hit Enter again.

You should see all the available options in the following screen:

Domain name to IP Address Lookup

To find the IP address of any domain, use the following syntax.

nslookup your-domain.com

For example, to find the IP address of the domain www.facebook.com run the following command:

nslookup www.facebook.com

You should see the IP address of the domain www.facebook.com in the following screen:

In the above example, we requested the IP address of the domain facebook.com.

The Nslookup utility queries the DNS server and returns with the IP address as shown in the above screen.

IP Address to Domain name Lookup

To find the domain name of any IP address, use the following syntax:

nslookup ip-address

For example, to find the domain name of the IP address 8.8.4.4 with the following command:

nslookup 8.8.4.4

You should see the domain name of the IP 8.8.4.4 in the following screen:

Find the NS Records of a Domain

If you want to find which name servers are authoritative for a domain, by set the query type to NS and enter the domain name as shown below:

nslookup -type=ns your-domain.com

For example, to find the NS records of the domain yahoo.com use the following command:

nslookup -type=ns yahoo.com

You should see the NS records of your domain yahoo.com in the following screen:

Find the MX Records of a Domain

If you want to find all the mail servers configured to a particular domain, use the following syntax:

nslookup -type=mx your-domain.com

For example, find all the mail servers configured for the domain netadmintools.com use the following command:

nslookup -type=mx netadmintools.com

You should see the following screen:

In the above screen, you should see that the domain netadmintools.com has 2 MX records with priorities 10 and 20.

Find the SOA Records of a Domain

To find the SOA (start of authority) records of any domain, use the following syntax:

nslookup -type=soa your-domain.com

For example, to find the SOA records of the domain netadmintools.com use the following command:

nslookup -type=soa netadmintools.com

You should see the SOA records in the following screen:

Find All DNS Records Of a Domain

To find all DNS records of a specific domain, use the following syntax:

nslookup -type=any your-domain.com

For example, to find all the DNS records of the domain yahoo.com use the following command:

nslookup -type=any yahoo.com

You should see all the records of the domain yahoo.com in the following screen:

Enable Debug mode with Nslookup

If you want to display more information about your query and answer, you will need to enable debug mode with Nslookup.

For example, to find more information of the domain yahoo.com by enabling debug mode as shown below:

nslookup -debug yahoo.com

You should see the detail information about your domain in the following screen:

Use Alternate DNS Server

If you run into issues accessing your website on your internal network, this may be a problem related to your internal DNS server.

In this case, you can use google DNS server to troubleshoot the issue.

To use a google DNS server, follow the below steps:

1. Open the command line terminal, type nslookup and hit Enter to open nslookup in interactive mode.

2. Type “server google-dns-server-ip” and hit Enter.

3. Type the domain name that you want to troubleshoot and hit Enter. You should see the following screen:

Troubleshoot DNS Resolution Issues

In this section, we will learn how to troubleshoot DNS when DNS resolution is not working.

1. Check Network Connectivity

The first thing you should check is your network connectivity.

To check the network connectivity, open the Network and Sharing Center and click on the Ethernet connection. You should see the following screen:

Here you should see a valid active internet connection.

2. Check your DNS Server Connectivity

Next, you need to find the IP address of your DNS server and check whether it is reachable or not.

To find the DNS IP address, open the Network and Sharing Center and click on the Ethernet connection and click on the Details button. You should see the following screen:

In the above screen, you should see that your DNS server IP address is 100.100.2.136 and 100.100.2.138.

Next lets open the command-line interface (Start > RUN > type cmd and hit enter) and run the ping command to check the DNS server connectivity as shown below:

In the above screen, you should see that the DNS server is reachable from your computer.

3. Flush DNS Cache

The DNS cache stores the information of all visited websites, IP addresses and resource records.

Using an outdated DNS cache can lead to DNS resolution errors, so it is recommended that you flush the DNS cache periodically.

To flush the DNS cache, open your command line interface and run the following command:

ipconfig /flushdns

You should see the following screen:

4. Release/Renew your DHCP Server IP address

If your network interface is configured to pull DNS information from DHCP server, then there is a possibility of IP address conflict or old DNS server information.

To resolve this, you will need to release and renew your DHCP server IP address.

Open the command line interface and run the following command to release and renew the IP address.

IPCONFIG /RELEASE
IPCONFIG /RENEW

Next, run the following command to see your new IP address and DNS server:

IPCONFIG /ALL

Conclusion

In the above article, we’ve learned how to troubleshoot DNS related issues with Nslookup command-line utility.

Hopefully the steps and screen shots above can help you resolve any of your issues or get you closer to a resolution

Please leave any questions or comments below!