NSLookup is a very useful tool for testing specific DNS servers.  For instance, if you are having DNS resolution issues or if you are transferring your DNS records to different DNS servers, you can use nslookup to test the authoritative name servers for your domain.  This will enable you to ensure that each of the authoritative servers for your domain are serving all the domain DNS records correctly.  There is a command with a similar function in Linux, called ‘dig‘, however I will not cover use of that command in this post.

If you are planning on transferring your DNS records to different name servers, I would recommend having the DNS records created on the new servers first.  Then, you can use nslookup to verify that the new records are in place before you change the authoritative DNS servers for your domain in your registrar account.

NSLookup has been included in every recent version of Microsoft Windows.  It can be accessed by simply opening up a command prompt and typing the ‘nslookup’ command:

Now that you are running the nslookup program, you can select the server you want to use by simply typing “server <server IP address>”.  This sets the focus on the server that you want to test.  Any subsequent queries for DNS records will use this server until you select a different server.  For example:

By default, nslookup is set to query for ‘A’ records.  So, if you want find the A record for www.binarywar.com, you simply type that in, like so:

If you want to query for the MX records for a domain, you will first need to change the query type.  That is done using “set q=mx”, as shown here:

(you can also use set querytype=MX or set type=MX)

Then, type in the domain for which you would like to see the MX records:

Here are the various record types you can use with the “set q=” command:

  • A
  • ANY
  • GID
  • MG
  • MR
  • MX
  • NS
  • PTR
  • SOA
  • TXT
  • UID
  • WKS

You can find a description of these record types on this page:


In addition, here is the command reference for the nslookup utility:


Leave a Reply

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