Windows nslookup equivalent in Linux
Queries DNS servers to resolve hostnames to IP addresses and inspect DNS records.
nslookup
dig / nslookup
dig / nslookup
dig / nslookup
Overview
What this command does
On Windows, "nslookup" is used to look up DNS records. On Linux, the closest practical mapping shown here is "dig / nslookup". Queries DNS servers to resolve hostnames to IP addresses and inspect DNS records. This reference is grouped under Networking.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows nslookup maps to dig / nslookup for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
For the broader concept behind this mapping, read Linux networking for Windows users.
Practical tasks
Common use cases
Look up DNS records
Queries DNS servers to resolve hostnames to IP addresses and inspect DNS records.
dig google.com
A record (IPv4 address)
dig google.com MX
Mail server records
dig google.com NS
Name server records
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
nslookup google.com
dig google.com
dig +short google.com
dig google.com MX
dig -x 8.8.8.8
Walkthrough
Examples with explanations
# Windows: nslookup google.com
nslookup google.com # works just like Windows
dig google.com # detailed DNS info
dig +short google.com # just the IP address
dig google.com MX # who handles Google's email
dig -x 8.8.8.8 # what host is 8.8.8.8?
Reference
Common options and variations
| Command or option | Use |
|---|---|
dig google.com | A record (IPv4 address) |
dig google.com MX | Mail server records |
dig google.com NS | Name server records |
dig +short google.com | Just the IP, no extra info |
dig -x 8.8.8.8 | Reverse lookup — IP to hostname |
nslookup google.com | Simple lookup (works same as Windows) |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "dig / nslookup" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | dig / nslookup |
Same command on this distribution. |
| Fedora | same command | dig / nslookup |
Same command on this distribution. |
| Arch | same command | dig / nslookup |
Same command on this distribution. |
Keep learning