Using Nslookup Command to List DNS Servers and Records

Nslookup (name server lookup) is a command-line utility that is used to diagnose and verify DNS servers and records, and detect problems with resolving names in the DNS subsystem. The nslookup utility was originally developed as part of the BIND package and ported to Windows by Microsoft. At this moment Nslookup is a built-in tool in all supported versions of Windows OS.

How to Use Nslookup to List DNS Records?

Using the nslookup utility, you can determine the IP address of any server by its DNS name, perform the reverse conversion (reverse DNS lookup), get information about the various DNS records of the specific domain name.

When running, Nslookup sends queries to the DNS server that is specified in the settings of your network connection. This address is considered as a default (preferred) DNS server. The user can specify the address of any other available DNS server. As a result, all the following DNS queries will be sent on it.

You can use the nslookup utility in interactive or non-interactive mode.
To run a DNS query using nslookup tool in non-interactive mode, open a Command prompt and run the command:


nslookup list dns servers

In this example, we requested the IP address of domain. The nslookup utility queries the DNS server (it is specified in the Server line) and it returned that this name corresponds to the IP address

Such a response indicates that your DNS server is available, works properly and processes requests for resolving DNS names.

If you received such an answer:


Address: хх.хх.хх.хх

*** can't find Non-existent domain

This means that no entries in the DNS zone have been found for this name.

If your DNS server is unavailable or not responding, you will receive a DNS request timed out error.

nslookup dns server list

In this case, check if you have specified the correct DNS server address and whether there is a problem with the network connection from the IS provider.

The Non-authoritative answer means that the DNS server that executed the request is not the owner of the zone (there are no records about this domain in its database), and to perform name resolution a recursive query to another DNS server was used.

You can access an authoritative server by specifying its address directly in the parameters of the nslookup utility. For example, to resolve a name on the authoritative DNS server (that contains this domain) use the command:


When you run nslookup without parameters, the utility switches to the interactive mode. In this mode, you can execute various commands. A complete list of available internal commands of the nslookup utility can be displayed by typing a question.

Tip. Note that the commands of the nslookup utility are case sensitive.

nslookup name server

To close nslookup interactive session, type exit and press Enter.

To find the DNS servers that are responsible for a specific domain (authoritative servers), run the following commands:

set query=ns

windows check dns server command line

You can perform the reverse queries (get DNS name by IP address), just type the IP address in the nslookup interactive prompt and press Enter.

nslookup show dns server

You can specify the type of DNS records that nslookup should return. For example, to list all mail servers configured for a particular domain, run the command:

nslookup -type=mx

list all dns servers in domain

Non-authoritative answer:   MX preference = 10, mail exchanger =   MX preference = 20, mail exchanger =      internet address =      internet address =

As you can see, this domain has 2 MX records with priorities 10 and 20 (the lower the number, the higher the priority of the address). If the MX record is not displayed, it’s likely that they are simply not configured for this domain.

To list all DNS records in the domain zone, run the command:

nslookup -type=any

nslookup list all records

Non-authoritative answer:   internet address =   nameserver =   nameserver =   MX preference = 10, mail exchanger =   MX preference = 20, mail exchanger =       internet address =       internet address =      internet address =      internet address =

Debug option allows you to obtain additional information contained in the headers of client DNS requests and server responses (lifetime, flags, record types, etc.):

set debug

list all dns records for a domain nslookup

I enjoy technology and developing websites. Since 2012 I'm running a few own websites, and share useful content on gadgets, PC administration and website promotion.
Cyril Kardashevsky

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.