Command library / nslookup
nslookup
Query DNS the simple, interactive-friendly way
An older, simpler DNS lookup tool than dig — available on both Linux and Windows, which makes it the one that works everywhere. One-shot mode is just the domain name; giving a second argument picks a specific DNS server to ask instead of the default.
Practice nslookupUsage
nslookup name [server]
Options and flags
namethe domain name to look up
serverDNS server to query instead of the default
-typeTYPErecord type to query, e.g. -type=MX
Examples
nslookup example.comThe A record for example.com, using your default DNS server.
nslookup example.com 8.8.8.8Same lookup, but asking Google's resolver specifically.
nslookup -type=MX example.comWhich servers handle mail for this domain.
Common mistakes
nslookup 8.8.8.8 example.com nslookup example.com 8.8.8.8
The name you're looking up comes first; the DNS server to ask comes second — reversed, nslookup tries to look up '8.8.8.8' using 'example.com' as a name server.