Test DNS Servers Directly with nslookup
Use nslookup's classic two-argument form to query a chosen resolver and inspect record types.
01Command
$ nslookup example.com
nslookup example.com 8.8.8.8
nslookup -type=MX gmail.com02What it does
nslookup's killer feature on macOS is its second argument: naming a server queries it directly instead of the system-configured resolvers, which is exactly how you verify whether a rogue DNS entry is cached locally. It separates the returned `Server:`/`Address:` pair from the answer, making resolver mismatches obvious. `dig` is the more modern tool, but nslookup's server-targeting syntax remains the quickest sanity check.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- nslookup(1) — Linux manual pageEvidence: Documents interactive/query mode, server argument and -type= selectors.
- dig — macOS Command ReferenceEvidence: Cross-reference to dig, the modern macOS default for DNS queries.
Last verified: 2026-09-17 · Category: Network
06Related solutions
Erase the broken Spotlight database so macOS re-indexes your drive from scratch.
Read the serial number, model identifier and chip without opening About This Mac.
See how many charge cycles the battery has used and its health condition.