nslookup is a DNS lookup command inherited from the original BSD implementation. It has an interactive mode and a command-line mode, and is familiar to generations of administrators from Windows as well as Unix.
nslookup example.com # A record
nslookup example.com 8.8.8.8 # using a specific resolver
nslookup -type=MX example.com # mail servers
Modern DNS tooling (dig, host) is generally preferred because nslookup's output format is inconsistent and it silently falls back to default resolvers in ways that can mask the bug you are trying to diagnose. It persists largely because it works the same everywhere.
Discussed in:
- Chapter 12: Networking — DNS