nslookup command snippets
Copy-paste-ready nslookup commands for DNS lookups, reverse queries, record type checks, and debug output.
- Look Up a Domain IP Address with nslookup
- Perform a Reverse DNS Lookup with nslookup
- Query the A Record with nslookup
- Query MX Records with nslookup
- Query NS Records with nslookup
- Query SOA Records with nslookup
- Query TXT Records with nslookup
- Query All DNS Records with nslookup
- Query a Specific DNS Server with nslookup
- Enable Debug Output with nslookup
- Set a Custom Timeout with nslookup
- Query CNAME Records with nslookup
Copy-paste-ready nslookup commands for common DNS lookup tasks.
Look Up a Domain IP Address with nslookup
nslookup queries the default DNS resolver and returns the A record (IPv4 address) for the specified domain.
nslookup example.comPerform a Reverse DNS Lookup with nslookup
nslookup resolves an IP address to its associated domain name by querying the PTR record in the
in-addr.arpa zone.
nslookup 203.0.113.50Query the A Record with nslookup
nslookup retrieves the IPv4 address mapped to a domain name using the
-type=a flag.
nslookup -type=a example.comQuery MX Records with nslookup
nslookup returns the mail exchange (MX) servers responsible for handling email delivery for the specified domain.
nslookup -type=mx example.comQuery NS Records with nslookup
nslookup lists the authoritative nameservers for a domain by querying the NS record type.
nslookup -type=ns example.comQuery SOA Records with nslookup
nslookup retrieves the Start of Authority (SOA) record, which contains the primary nameserver, admin contact, zone serial number, and refresh intervals.
nslookup -type=soa example.comQuery TXT Records with nslookup
nslookup displays TXT records that store SPF policies, DKIM keys, and domain verification tokens.
nslookup -type=txt example.comQuery All DNS Records with nslookup
nslookup retrieves all available DNS record types for a domain using the
-type=any flag. Some DNS servers restrict this query type.
nslookup -type=any example.comQuery a Specific DNS Server with nslookup
nslookup sends the query to a specified DNS server instead of the system's default resolver. This example queries Google Public DNS (8.8.8.8).
nslookup example.com 8.8.8.8Enable Debug Output with nslookup
nslookup displays full DNS response details -- including TTL values, query sections, and authority records -- when the
-debug flag is set.
nslookup -debug example.comSet a Custom Timeout with nslookup
nslookup waits the specified number of seconds for a DNS server response before timing out. The default timeout is 5 seconds.
nslookup -timeout=10 example.comQuery CNAME Records with nslookup
nslookup returns the canonical name (alias) record for a domain, showing which domain name the alias resolves to.
nslookup -type=cname www.example.com