Operations 5 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Mastering nslookup: How to Query A, NS, SOA, MX, and More DNS Records

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.com

2. View a domain's NS records

Checking NS records reveals the authoritative name servers for a domain.

$ nslookup -type=ns example.com

3. Query a domain's SOA record

The SOA record shows the start of authority and zone information.

$ nslookup -type=soa example.com

4. Find MX records for email exchange

MX records list mail servers responsible for receiving email for the domain.

$ nslookup -query=mx example.com

5. Retrieve all available DNS records

Using the any type displays every record type the server will return.

$ nslookup -type=any example.com

6. Check a specific DNS server

Query a particular DNS server to see if it is responsive and returning data.

$ nslookup example.com ns1.nsexample.com

7. Perform a reverse DNS lookup

Reverse lookups map an IP address back to its domain name.

$ nslookup 10.20.30.40

8. 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.arpa

9. Change the response timeout

Adjust the timeout (in seconds) to give the server more or less time to respond.

$ nslookup -timeout=20 example.com

10. Enable debug mode

Debug mode provides detailed information about the query process and responses.

$ nslookup -debug example.com
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DNScommand-linenslookupDNS Records
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.