Nslookup - DNS Lookup and Troubleshooting¶
``
``
✅ All commands copied to clipboard!
Overview¶
nslookup is a network administration command-line tool for querying the Domain Name System (DNS) to obtain domain name or IP address mapping, or other DNS records. It's available on most operating systems and is essential for DNS troubleshooting and network diagnostics.
Basic Syntax¶
# Non-interactive mode
nslookup [options] [name] [server]
# Interactive mode
nslookup
nslookup -
nslookup - [server]
Essential Commands¶
Basic DNS Lookups¶
``
``
``
Record Type Queries¶
``
``
``
``
``
``
``
``
``
``
Interactive Mode¶
Starting Interactive Mode¶
``
``
Interactive Mode Commands¶
``
``
``
``
``
``
``
Advanced Options¶
Debug and Troubleshooting¶
``
``
``
``
``
``
``
Popular DNS Servers¶
``
``
``
``
Common Use Cases¶
Email Server Troubleshooting¶
``
``
Domain Verification¶
``
``
Network Diagnostics¶
``
``
``
Batch Operations¶
Multiple Queries¶
``
Error Messages¶
Error | Meaning |
---|---|
** server can't find domain: NXDOMAIN |
Domain doesn't exist |
** server can't find domain: SERVFAIL |
DNS server failure |
** server can't find domain: REFUSED |
Query refused by server |
** Request timed out |
No response from DNS server |
** No response from server |
DNS server unreachable |
Installation¶
Linux (Ubuntu/Debian)¶
Linux (CentOS/RHEL/Fedora)¶
Windows¶
nslookup comes pre-installed with Windows.
macOS¶
nslookup comes pre-installed with macOS.
Tips and Best Practices¶
- Use specific DNS servers for testing to avoid cached results
- Enable debug mode when troubleshooting complex issues
- Check multiple record types for comprehensive domain analysis
- Use reverse lookups to verify IP address ownership
- Compare results from different DNS servers to identify inconsistencies
- Interactive mode is useful for multiple queries on the same server
- Combine with other tools like dig and host for complete DNS analysis
Related Commands¶
dig
- More detailed DNS lookup toolhost
- Simple DNS lookup utilityping
- Test network connectivitytraceroute
- Trace network pathwhois
- Domain registration information