nslookup is a built-in Windows command-line tool used to query DNS servers and troubleshoot domain name resolution issues. It allows you to check IP addresses, DNS records, mail servers, and other information associated with a domain name.
What Is Nslookup?
When you enter a website address into your browser, DNS translates that domain name into an IP address. Nslookup lets you perform these DNS lookups manually, making it useful for diagnosing networking and website issues.
Common uses include:
- Finding a domain’s IP address
- Checking DNS records
- Verifying DNS propagation
- Troubleshooting email delivery issues
- Testing specific DNS servers
Basic Nslookup Command
To look up the IP address of a domain:
nslookup example.com
The output typically shows:
- The DNS server used
- The DNS server’s IP address
- The resolved IP address for the domain
Query A Specific DNS Server
You can perform the lookup using a specific DNS server instead of your default one.
For example, to use Google’s public DNS:
nslookup example.com 8.8.8.8
This is useful when comparing DNS results between providers.
Find MX Records
MX (Mail Exchange) records identify the mail servers responsible for receiving email for a domain.
Run:
nslookup -type=mx example.com
This command is commonly used when troubleshooting email delivery problems.
Find NS Records
NS (Name Server) records show which DNS servers are authoritative for a domain.
Run:
nslookup -type=ns example.com
This can help verify whether a domain is using the expected nameservers.
Find TXT Records
TXT records are often used for email authentication technologies such as SPF, DKIM, and domain verification.
Run:
nslookup -type=txt example.com
The results may contain one or more TXT entries associated with the domain.
Reverse DNS Lookup
A reverse lookup determines which hostname is associated with an IP address.
For example:
nslookup 8.8.8.8
If a PTR record exists, the associated hostname will be displayed.
Interactive Mode
Nslookup also supports an interactive mode.
Start it by typing:
nslookup
You’ll see a prompt similar to:
You can then enter commands such as:
set type=mx
example.com
To exit interactive mode:
exit
Check DNS Propagation
After changing DNS records, you can use nslookup to verify whether the new records are visible.
For example:
nslookup -type=a example.com
You can compare results from different DNS servers to determine whether updates have propagated.
Things To Watch Out For
Nslookup is a useful troubleshooting tool, but DNS results can vary depending on caching and DNS provider settings.
Common issues include:
- Querying cached DNS data
- Using the wrong record type
- Checking the wrong nameserver
- DNS changes not fully propagated
- Firewall or network restrictions affecting queries
If results appear incorrect, try querying multiple public DNS servers and allow time for DNS propagation.
Alternatives To Nslookup
While nslookup remains widely used, other DNS tools provide additional functionality.
Popular alternatives include:
dig
host
- PowerShell’s
Resolve-DnsName
- Online DNS lookup tools
Many network administrators prefer these tools for advanced DNS troubleshooting.
Join The Discussion
How do you use nslookup in your workflow? Have you used it to troubleshoot website issues, email problems, DNS propagation delays, or network configuration errors? Share your favorite commands, troubleshooting techniques, and questions to help others get more value from this essential networking tool.