Mastering nslookup: How to Query A, NS, SOA, MX, and More DNS Records
This guide walks you through using the nslookup command to retrieve A, NS, SOA, MX, any, PTR, and other DNS records, adjust timeout and debug settings, and query specific DNS servers, providing clear examples and screenshots for each operation.
The article presents a practical tutorial on using the nslookup command-line tool to query various DNS record types, customize query options, and troubleshoot DNS servers.
1. Find a domain's A records
Use nslookup to list all A records and their associated 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 mail servers responsible for receiving email for the domain.
$ nslookup -query=mx example.com5. Retrieve all available DNS records
Using the any type displays every record type the server will return.
$ nslookup -type=any example.com6. Check a specific DNS server
Query a particular DNS server to see if it is responsive and returning data.
$ nslookup example.com ns1.nsexample.com7. Perform a reverse DNS lookup
Reverse lookups map an IP address back to its domain name.
$ nslookup 10.20.30.408. View PTR records
PTR records are used in reverse DNS to associate an IP address with a domain name. The IP must be reversed and appended with in-addr.arpa.
$ nslookup -type=ptr 96.96.136.185.in-addr.arpa9. Change the response timeout
Adjust 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.
