NSLookup Command Guide: Check DNS Records on Windows, macOS and Linux
NSLookup is a command-line DNS diagnostic tool available on Windows and many other operating systems. It can query a domain, request specific record types and send a query to a selected DNS server.
NSLookup is useful for comparing the default resolver with public or authoritative nameservers during troubleshooting.
Compare NSLookup results with the online DNS Lookup Tool.
Basic NSLookup Commands
Running nslookup followed by a hostname requests its address records through the current default resolver. Adding a DNS server address sends the query directly to that resolver.
Step-by-Step Process
- Open Command Prompt, Terminal or a shell.
- Run nslookup example.com.
- Review the DNS server used for the query.
- Request a specific record type.
- Query a second resolver for comparison.
- Compare the answer, TTL and errors.
Important Concepts
Basic lookup
nslookup example.com
Specific resolver
nslookup example.com 1.1.1.1
MX lookup
nslookup -type=MX example.com
TXT lookup
nslookup -type=TXT example.com
NS lookup
nslookup -type=NS example.com
Interactive mode
Run nslookup without arguments, then use set type= commands.
Common Problems and Mistakes
- Querying the root domain instead of the affected subdomain
- Confusing non-authoritative answer with an error
- Testing only one resolver
- Ignoring IPv6 records
- Assuming an address response proves the website is healthy
- Not checking the authoritative nameserver
Troubleshooting Checklist
- Use the exact hostname.
- Identify the resolver shown.
- Request the correct record type.
- Compare at least two resolvers.
- Check authoritative NS records.
- Test the actual service after DNS resolves.
Frequently Asked Questions
What does non-authoritative answer mean?
The response came from a recursive resolver or cache rather than directly from the domain’s authoritative server.
Can NSLookup check MX and TXT records?
Yes. Use the -type option or interactive mode.
Is NSLookup the same as a global DNS checker?
No. NSLookup normally tests from one device and resolver; a global checker compares multiple locations.
Conclusion
NSLookup Command Guide is an important topic for anyone managing websites, networks or online services. Use the diagnostic steps above to separate local-device, resolver, authoritative DNS and application problems.