← All commands
Topic hub Networking
Windows Linux Networking Expanded guide

Windows nslookup equivalent in Linux

Queries DNS servers to resolve hostnames to IP addresses and inspect DNS records.

Windows nslookup
→
Linux equivalents
Debian/Ubuntu same command
dig / nslookup
Fedora same command
dig / nslookup
Arch same command
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.

Migration tip: <code>nslookup</code> works on Linux too, but <strong><code>dig</code></strong> gives much more detail and is preferred by administrators. It's in the <code>dnsutils</code> package.

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.

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 optionUse
dig google.comA record (IPv4 address)
dig google.com MXMail server records
dig google.com NSName server records
dig +short google.comJust the IP, no extra info
dig -x 8.8.8.8Reverse lookup — IP to hostname
nslookup google.comSimple 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.

DistributionPackage manager / baseEquivalent commandDifference 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

Related Networking commands