Mastering DNS Lookups with nslookup: 10 Essential Commands
This guide explains how to use the nslookup command to retrieve various DNS records—including A, NS, SOA, MX, any, specific server, reverse, PTR, timeout, and debug information—providing clear examples and command syntax for each query type.
1. Find a domain's A record
Use nslookup to list A records and their IP addresses.
$ nslookup example.com2. View a domain's NS records
Checking NS records reveals the authoritative name servers for a domain.
$ nslookup -type=ns example.com3. Query a domain's SOA record
The SOA record shows the start of authority and zone information.
$ nslookup -type=soa example.com4. Find MX records for email exchange
MX records list the mail servers responsible for receiving email for the domain.
$ nslookup -query=mx example.com5. List all available DNS records for a domain
Using the "any" type returns every DNS record the server will provide.
$ nslookup -type=any example.com6. Check a specific DNS server
Query a particular DNS server to see its response and availability.
$ nslookup example.com ns1.nsexample.com7. Perform a reverse DNS lookup
Verify which domain name is associated with an IP address.
$ nslookup 10.20.30.408. View PTR records
PTR records confirm the mapping from an IP address back to a domain name; use the in-addr.arpa format.
$ nslookup -type=ptr 96.96.136.185.in-addr.arpa9. Adjust the query timeout
Manually set the timeout (in seconds) to give the server more or less time to respond.
$ nslookup -timeout=20 example.com10. Enable debug mode
Debug mode provides detailed information about the query process and responses.
$ nslookup -debug example.comSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
