3.2 Troubleshooting DNS with nslookup

Basics

When DNS stops working, no one on your network can access websites or send email. The implications are obvious and can lead to a lot of unhappy users that will depend on you for help. You can use the command-line tool nslookup to troubleshoot the issue.

You should know the following terms:

  • ipconfig
  • nslookup
  • ping

The nslookup command has a number of parameters that can be added to change its functionality and the data it returns. Remember that like with other command-line tools, if you type a ? after the command in the command window you’ll see all of the options available for that command.

Some of the more common nslookup uses include

  • nslookup domainname or URL.  This command returns the IP address(es) for the domain or URL you entered. The command is looking up the A record. You do this when you know the domain and want to find the IP address associated with that domain.
  • nslookup IP address. This is a reverse DNS record lookup. You use this command when you have an IP address and want to find the domain name associated with it. Not all domains will have a reverse record, so this will not always return information.
  • The MX record (mail exchange record) lookup looks for the mail servers that accept email for that domain.

If you’ve verified a website is not working, you can run an A record nslookup to obtain the IP address. Then complete a reverse lookup with the returned IP addresses to verify they are indeed matched to the domain. If the reverse lookup is incorrect, unknown, or nonexistent, you may need to visit your DNS server to determine whether it is using an outdated DNS cache. Some network administrators will flush the DNS cache periodically to prevent outdated DNS data being stored.

You can use the ping command to determine if your DNS server has connectivity. If it does, you may want to use ipconfig to flush your DNS cache. If your DNS server pulls information from your DHCP server, you can use ipconfig to release and renew an IP address. Be sure to get confirmation from an IT Director or network administrator before undertaking these tasks. 

Review the nslookup command and its parameters in the nslookup article from Microsoft and find detailed directions for troubleshooting using nslookup in the resources. The article links to a large number of parameters that can be used with nslookup.

Here are additional resources you may find useful:

Complete the following task or self-assessment:

  • Explore the nslookup command using the command shell on any computer.

You may not want to go so far as to flush or renew your DNS cache, but review the resources, especially the article from Microsoft, to determine the available nslookup parameters and their correct syntax.