Update 1 Nov 2017. Added Non-interactive examples for documenting or scripting test and verification nslookup commands.

Non-Interactive nslookup examples (for scripting, documentation, and quality testing).

  • nslookup -type=CNAME sample.fqdn.com some.dns.server
    • type can be any valid DNS record type (AAAA, A, PTR, CNAME, NS, etc)
    • substitute your specific query name for the fqdn and target dns server as needed

Using nslookup interactively to verify and debug DNS records.

  • server
  • # point to different DNS server with “server x.x.x.x” command
  • # popular public servers include,,, (google & opendns)
  • # change lookup record type with “set type=xxx” command
  • # important record types include: A, PTR, MX, TXT, CNAME, …
  • # reverse IP-to-name records of type PTR have the form below (example IP, reverse and append “.in-addr.arpa.”)
  • set type=PTR
  • # ALWAYS use a trailing dot at the end of fully-qualified-domain-names (FQDN’s)
  • set all
  • # use “set all” to view current nslookup settings (server, record type, etc)

These examples assume the MS Windows version of nslookup. Most of the syntax will be the same on Linux systems.


About notesbytom

Keeping technology notes on WordPress.com to free up my mind to solve new problems rather than figuring out the same ones repeatedly :-).
This entry was posted in System Administration and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s