Interactive mode
Type nslookup alone, then set type=MX and enter names at the > prompt. Type exit to leave.
Monitor
Protect
Manage
By role
Security
Renewals
Monitoring
nslookup is a command-line tool that queries a DNS server for a record: run nslookup example.com for the IP address, or add -type=MX, -type=NS or -type=TXT for other records. A second argument picks the DNS server to ask, such as 1.1.1.1.
| Goal | Command | Notes |
|---|---|---|
| IPv4 and IPv6 address | nslookup example.com | Uses your default resolver |
| Use a specific resolver | nslookup example.com 1.1.1.1 | Second argument is the DNS server |
| Mail servers | nslookup -type=MX example.com | Shows preference and exchanger |
| Nameservers | nslookup -type=NS example.com | Delegation as the resolver sees it |
| Text records | nslookup -type=TXT example.com | SPF, verification codes |
| Zone details | nslookup -type=SOA example.com | Serial and timers |
| Reverse lookup | nslookup 8.8.8.8 | Returns the PTR name |
| More detail | nslookup -debug example.com | Prints packets sent and received |
Syntax from Microsoft nslookup documentation. The Windows build tested here reported "unknown query type: CAA", so use dig for CAA records.
> nslookup -type=MX gmail.com
Server: dns.google
Address: 8.8.8.8
Non-authoritative answer:
gmail.com MX preference = 5, mail exchanger = gmail-smtp-in.l.google.com
gmail.com MX preference = 10, mail exchanger = alt1.gmail-smtp-in.l.google.com
> nslookup -type=SOA example.com
example.com
primary name server = elliott.ns.cloudflare.com
serial = 2420077714
default TTL = 1800 (30 mins)This is the resolver that answered you, not the domain DNS host. If it shows an unexpected name, your network is overriding your DNS setting.
The resolver answered from cache or by recursion. Ask the authoritative nameserver for an uncached answer.
Check type and value. Add -debug to see the TTL of each record.
Nonexistent domain: the name does not exist. No records: the name exists but not that type. timed out: the server did not answer.
Type nslookup alone, then set type=MX and enter names at the > prompt. Type exit to leave.
Common on macOS and Linux, with fuller output and more options. See the dig command guide.
The DNS lookup tool runs the same query without a terminal.
nslookup sends a query to a DNS server and prints the answer. It is used to find the IP address of a domain, list MX, NS or TXT records, and run reverse lookups from an IP address to a hostname.
Open Command Prompt or PowerShell and type nslookup followed by a domain. For a record type use nslookup -type=MX example.com. Entering nslookup alone starts interactive mode, which you leave with exit.
It means the answer came from a resolver cache or a server that is not authoritative for the domain, not directly from the zone owner. The data is normally correct but may be as old as the TTL.
Both query DNS. nslookup ships with Windows and prints a shorter summary. dig is common on Linux and macOS, shows flags, TTLs and each response section, and has options like +trace, so it suits deeper debugging.
Add the server as the last argument: nslookup example.com ns1.dnshost.example. nslookup then asks that server directly instead of your default resolver, which shows what the zone itself says without cached data.
The browser may use its own cache, a different resolver such as DNS over HTTPS, or a hosts file entry, while nslookup talks to the configured DNS server directly. Compare both with the resolver specified explicitly.
Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.