DNS LOOKUP GUIDES

nslookup Commands: Practical DNS Lookup Examples

Use nslookup to check A, AAAA, MX, NS, TXT and CNAME records, choose a DNS server, and understand non-authoritative answers, NXDOMAIN and timeouts.

The nslookup command asks a DNS server about a name or address. For everyday troubleshooting, the most useful pattern is nslookup -type=TYPE name resolver: choose the record type, the exact DNS name and, when needed, the resolver you want to ask.

This guide walks through focused queries and explains what the output can establish. The examples use documentation domains; displayed sample answers are illustrative, not reports of live DNS data. Microsoft maintains the Windows nslookup command reference. Common queries also work in many macOS and Linux implementations, though installed tools and available options vary.

Start with a basic lookup

Open Command Prompt or PowerShell on Windows, or a terminal on a system with nslookup installed, and enter:

nslookup example.com

Without an explicit server argument, the command uses its default DNS server. That may be a home router, an organization resolver or another address supplied by network configuration. It does not necessarily use the same resolver as a browser configured with its own encrypted DNS service.

For a repeatable investigation, specify the question rather than relying on defaults:

nslookup -type=A example.com. 1.1.1.1

The trailing dot makes the queried name explicitly absolute. It can help avoid search-suffix ambiguity in environments that append a local domain to entered names.

Choose the record type you actually need

Task Example command
Find IPv4 addresses nslookup -type=A example.com. 1.1.1.1
Find IPv6 addresses nslookup -type=AAAA example.com. 1.1.1.1
Inspect incoming mail routing nslookup -type=MX example.com. 1.1.1.1
Inspect published nameservers nslookup -type=NS example.com. 1.1.1.1
Read text records nslookup -type=TXT example.com. 1.1.1.1
Inspect an alias nslookup -type=CNAME www.example.com. 1.1.1.1

A missing answer for one type does not imply the name has no DNS records. For example, www might be an alias while the apex holds the domain’s mail records. Use the record-type guide when you are unsure which question matches the problem.

A and AAAA for website addresses

Query both address families if visitors report inconsistent access. A correct A answer cannot compensate for an unrelated bad AAAA destination on clients that use IPv6.

An address answer can also follow an alias chain. Inspect CNAME separately when you need to understand whether the hostname points to a service-managed name. The A versus CNAME comparison explains how those configurations differ.

MX for incoming mail

An MX result contains a preference number and exchange hostname. Lower preference numbers are normally preferred. Query the domain after the @ in an email address, not the entire address and not automatically its www hostname.

After identifying an exchange hostname, you can query its A and AAAA records. That still does not connect to SMTP, verify a mailbox or test delivery. Read the MX guide before interpreting an empty answer or the special null MX value.

TXT for verification and SPF discovery

A TXT lookup can return several records. Locate the expected verification string or a policy beginning with v=spf1 rather than assuming the first line is the one you need. Follow the TXT lookup and verification guide for owner-name and value checks, or the SPF record guide to interpret a policy.

For an underscore-prefixed record owner, query its exact name with a suitable client. For instance, the standard DMARC owner is _dmarc.example.com; a TXT query of example.com asks a different question. The general Bulk DNS Checker rejects underscore labels, so use a terminal for raw prefixed queries. For policy discovery, the Bulk DMARC Checker accepts an ordinary domain and constructs its prefixed query internally.

Ask a specific DNS server

For reverse DNS, nslookup 192.0.2.25 1.1.1.1 asks for the documentation address’s PTR record. Use the Bulk Reverse DNS Checker to inspect one or many IPv4/IPv6 addresses and compare each PTR hostname with its forward A or AAAA answers. The PTR and FCrDNS guide separates confirmed names, mismatches and incomplete lookups. These checks do not enumerate every domain hosted on an IP.

The final argument selects the server to query:

nslookup -type=A example.com. 1.1.1.1
nslookup -type=A example.com. 8.8.8.8

Here, the addresses select Cloudflare and Google public resolvers respectively. Comparing the same name and type can help distinguish resolver-specific answers or cached versions. Record the time of each query along with the chosen resolver.

Use public resolvers for public names. Internal organization names may only resolve through an approved internal resolver or VPN. Sending those names to a public resolver will not recreate an internal DNS view and can disclose the queried names outside your organization.

Different answers need interpretation. Caches, geographic routing, CDN policy and private DNS views can all matter. A disagreement does not identify which response is correct on its own. Google’s Public DNS troubleshooting documentation explains useful comparisons and resolver-level investigations.

Read the server section separately from the answer

A simplified, illustrative response might look like this:

Server:  resolver.example
Address: 1.1.1.1

Non-authoritative answer:
Name:    example.com
Address: 192.0.2.10

The top section identifies the DNS server being asked. The bottom section contains information about the name you queried. Confusing those sections can lead you to mistake a resolver’s address for the website’s address.

“Non-authoritative answer” is normal when asking a recursive resolver. It means the response is not being presented as an authoritative answer from the server for that zone; it is not automatically an error or a sign that the information is untrustworthy.

If the server name appears as “Unknown,” the resolver’s address may lack a usable reverse name. Check whether the actual question succeeds before treating that label as a DNS outage.

The shape of output varies by platform and record type. For detailed answer sections and visible TTLs, a tool such as dig can be more convenient than trying to interpret every platform’s default nslookup format.

Interpret failures before changing DNS

NXDOMAIN or nonexistent domain

The resolver reports that the queried name does not exist in its DNS view. Check spelling, the complete hostname and any search suffix. This is different from an existing name with no records of the requested type. The NXDOMAIN troubleshooting guide separates domain-owner and local-client investigations.

No records of the requested type

The name can exist without an MX, TXT or AAAA record. Confirm the type and owner name. Adding an unrelated record simply to avoid an empty result can make the configuration less accurate.

SERVFAIL or server failure

The server could not complete resolution. Potential causes include authoritative-server problems or DNSSEC validation issues. This does not mean the domain is available for registration, and blindly recreating an A record is not a general fix.

Timeout

A timeout means the client did not receive a usable answer within its waiting period. Network filtering, an unreachable DNS server or other connection problems can be involved. It does not establish that the requested name is absent.

Use interactive mode for repeated queries

You can also enter nslookup without a query, then issue commands at its prompt:

nslookup
server 1.1.1.1
set type=MX
example.com.
set type=TXT
example.com.
exit

Enter these lines one at a time. The record type remains selected until you change it or leave the session, which is useful but easy to forget. If a later result looks wrong, confirm the current type and server rather than assuming every line starts with fresh defaults.

For notes, support requests or scripts, separate noninteractive commands often make the question clearer because each command includes its own name, type and resolver.

When a browser-based batch lookup is easier

For several domains, repeatedly editing terminal commands makes comparison and record keeping more work. DNSBatch lets you enter up to 500 domains, select several supported types, track progress, filter completed results and export a CSV.

Open the Bulk DNS Checker and repeat the same exact names and types you used in the terminal. To make the comparison meaningful, select the equivalent resolver. Browser DNS-over-HTTPS and ordinary terminal DNS can still encounter different network conditions.

If you only need NS records, the Bulk NS Checker compares an expected nameserver set across up to 500 domains and lists missing or unexpected values. Like a recursive terminal lookup, it is not a parent-zone delegation audit.

For email policy questions, raw TXT output is only the starting point. The SPF inspection tool follows supported literal dependencies, while the DMARC checker discovers direct and inherited policies. Neither command output nor a static tool finding proves that a real message passes authentication.

Common nslookup questions

Does nslookup show every record in a domain?

No. A normal query asks about a specific owner name and type. Even an ANY query is not a reliable complete inventory. Use the DNS provider’s zone export or management interface when you need the zone configuration, and do not confuse record lookup with subdomain discovery.

Does nslookup test a website or mail server?

It inspects DNS responses. It does not prove HTTP, TLS, SMTP or mailbox health. Preserve its results as one piece of evidence and test the destination service separately.

Why can nslookup work while my browser fails?

The browser may use a different resolver, a cached result, a proxy or a different network path. The requested website hostname can also differ from the name you checked. Start by comparing the exact name and DNS provider before changing the public zone.