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.
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.com2. 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.com3. How to Query a Domain's SOA Record?
This reveals the start of authority and provides information about the zone.
$ nslookup -type=soa example.com4. 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.com5. 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.com6. 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.com7. 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.408. 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.arpa9. 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.com10. How to Enable Debug Mode?
Debug mode provides detailed information about the query process and the answers received.
$ 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.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
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.
