Fundamentals 5 min read

Master DNS Lookups: 10 Essential nslookup Commands Explained

This guide walks you through ten practical nslookup commands for retrieving A, NS, SOA, MX, any, PTR records and more, showing how to adjust timeouts, enable debugging, and query specific DNS servers to troubleshoot and verify domain configurations.

Open Source Linux
Open Source Linux
Open Source Linux
Master DNS Lookups: 10 Essential nslookup Commands Explained
Source: 网络工程师阿龙

1. How to Find a Domain's A Record?

You can use the following command to view the A records and their corresponding IP addresses.

$ nslookup example.com

2. How to View a Domain's NS Records?

By checking NS records you can see which authoritative servers serve a particular domain.

$ nslookup -type=ns example.com

3. How to Query a Domain's SOA Record?

This reveals the start of authority and provides information about the zone.

$ nslookup -type=soa example.com

4. How to Find MX Records for Email Exchange?

Check the MX records of a mail server to see if all mail servers are operating correctly.

$ nslookup -query=mx example.com

5. How to Retrieve All Available DNS Records for a Domain?

This broad query lists every DNS record type; you can then perform targeted lookups for specific types.

$ nslookup -type=any example.com

6. How to Check the Usage of a Specific DNS Server?

Beyond checking DNS records, you can use nslookup to query a particular DNS server and see if it is active and responsive.

$ nslookup example.com ns1.nsexample.com

7. How to Perform a Reverse DNS Lookup?

Sometimes you need to verify that an IP address maps back to a specific domain, which requires a reverse DNS query.

$ nslookup 10.20.30.40

8. How to View PTR Records?

By performing a reverse DNS query you can verify the IP belongs to a domain via its PTR record; you must reverse the IP and append in-addr.arpa.

$ nslookup -type=ptr 96.96.136.185.in-addr.arpa

9. How to Change the Reply Timeout Interval?

You can manually set the timeout (in seconds), increasing it to give servers more time to respond or decreasing it to see which servers respond faster.

$ nslookup -timeout=20 example.com

10. How to Enable Debug Mode?

Debug mode provides detailed information about the query process and the answers received.

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

networktroubleshootingDNScommand-linenslookup
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

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.