๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

๐ŸŒ Networking September 12, 2026 1

Linux Command: nslookup

Query DNS name servers interactively

Terminal โ€” Networking
Command
$ nslookup example.com
Output
Server: 8.8.8.8 Name: example.com Address: 93.184.216.34

nslookup queries DNS name servers to find the IP address of a domain or the domain name for an IP address. It is one of the most commonly used DNS troubleshooting tools. nslookup can query specific record types (A, AAAA, MX, TXT, CNAME, NS, SOA) and use specific DNS servers. It operates in interactive or non-interactive mode. While dig is more detailed and preferred by DNS administrators, nslookup is available on virtually every operating system (including Windows) and is simpler for basic queries.

Syntax

nslookup [OPTION]... [HOST] [SERVER]

Key Options

  • domain โ€” Look up domain A record
  • -type= โ€” Specify record type
  • domain server โ€” Use specific DNS server
  • -debug โ€” Show detailed query info

Examples

Look up domain

nslookup example.com

Output: Server: 8.8.8.8 Name: example.com Address: 93.184.216.34

MX records

nslookup -type=MX example.com

Output: example.com mail exchanger = 10 mail.example.com

TXT records

nslookup -type=TXT example.com

Pro Tips

  • Compare: nslookup domain 8.8.8.8 vs nslookup domain 1.1.1.1. Different results may indicate DNS propagation delays.
  • dig provides more detailed output with TTLs and authority info. nslookup is simpler for quick lookups.
  • nslookup shows a deprecation warning on some systems. It still works fine, but dig and host are the recommended alternatives.

Learn more: Full nslookup reference โ†’

Share this tip