Diagnose DNS Problems with nslookup
Resolve a domain manually and see which DNS server answers — the first test when a site won't load.
01Command
$ nslookup example.com :: query a specific record type: nslookup -type=MX gmail.com02What it does
nslookup prints both the DNS server it queried and the answer, so you can immediately tell whether the failure is DNS or the website itself. If the default server is your router and times out, query a public resolver directly (nslookup example.com 1.1.1.1) to compare. The -type option queries MX, TXT, NS, or other record types without entering interactive mode.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- nslookupEvidence: Reference documents nslookup usage and options including "set type=<record type>" for querying specific DNS record types.
- Nslookup — Name server lookupEvidence: Documents nslookup syntax and interactive commands such as set type= for MX/A/TXT queries.
Last verified: 2026-09-19 · Category: Network
06Related solutions
Purge cached DNS lookups so Windows re-resolves hostnames from scratch — the fix for 'the new server is live but my browser still hits the old one'.
The modern, scriptable replacement for nslookup: ask for exact record types, hit specific DNS servers, and see TTLs as objects.
One command that shows OS version, install date, boot time, memory, network adapters and installed hotfixes.