Operations 5 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Mastering DNS Lookups with nslookup: 10 Essential Commands

1. Find a domain's A record

Use nslookup to list A records and their 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 the mail servers responsible for receiving email for the domain.

$ nslookup -query=mx example.com

5. List all available DNS records for a domain

Using the "any" type returns every DNS record the server will provide.

$ nslookup -type=any example.com

6. Check a specific DNS server

Query a particular DNS server to see its response and availability.

$ nslookup example.com ns1.nsexample.com

7. Perform a reverse DNS lookup

Verify which domain name is associated with an IP address.

$ nslookup 10.20.30.40

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

9. Adjust the query timeout

Manually set 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.

network troubleshootingcommand-lineDNSnslookupDNS 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.