Footprinting & Reconnaissance · Module 02
nslookup
Query DNS servers to resolve names and pull records (A, MX, NS, TXT).
Safe to try on your own machine. Spin up your Kali Linux lab and practice away — on any system you own or have permission to test. That’s exactly how the pros learn.
Definition
nslookup (Name Server Lookup) is a command-line tool used to query DNS servers and retrieve DNS records.
Resolve domain names to IP addresses and retrieve DNS information.
DNS troubleshooting, network reconnaissance, domain investigation, and security analysis.
Key features
Retrieves the IP addresses behind domain names.
Queries records such as A, AAAA, MX, NS and TXT.
Identifies the mail servers for a domain (MX).
Retrieves a domain's authoritative name servers.
Lets you query a specific DNS server.
Supports multiple DNS queries within one session.
Important commands
nslookup example.comRetrieve DNS information for a domain.
nslookup example.com 8.8.8.8Query a specific DNS server.
nslookup -type=A example.comQuery IPv4 address records.
nslookup -type=MX example.comRetrieve mail exchange (MX) records.
nslookup -type=NS example.comRetrieve name server records.
nslookup -type=TXT example.comRetrieve TXT records (may include SPF).
nslookup -type=PTR 8.8.8.8Reverse DNS lookup for an IP address.
Practical examples
nslookup example.com
Purpose Retrieves DNS information, usually an IP address when resolution succeeds.
nslookup -type=MX example.com
Purpose Displays the available MX records for the domain.
nslookup -type=NS example.com
Purpose Retrieves the domain's name server records.
nslookup example.com 8.8.8.8
Purpose Queries Google's public resolver for the domain's DNS info.
Important points
- A / AAAA record: Map a hostname to an IPv4 / IPv6 address.
- MX record: Identifies the mail servers that receive email for a domain.
- NS record: Identifies the name servers for a DNS zone.
- PTR record: Supports reverse lookups from an IP back to a hostname.
- DNS caching: Cached records may affect the results a resolver returns.
- Limitations: A successful lookup does not prove a host is reachable or a service is running.
Common use cases
Investigate domain resolution failures.
Collect the DNS records tied to a domain.
Examine MX records and email infrastructure.
Investigate suspicious domains and how they resolve.
Verify DNS configuration and spot DNS-related issues.
This tool is taught in Module 02
Read the full written notes, with diagrams, defense and detection.