When troubleshooting DNS problems, two terms come up repeatedly: DNS lookup and NS lookup. They sound similar, but they serve different purposes. Understanding the distinction helps you use the right tool when diagnosing domain resolution issues, email delivery failures, or propagation delays.
What Is a DNS Lookup?
A DNS lookup is a query that retrieves any type of DNS record for a given domain. You can use a DNS lookup to check A records, AAAA records, MX records, TXT records, CNAME records, and more. It is the general-purpose operation for inspecting DNS data.
When you type a URL into a browser, your operating system performs a DNS lookup automatically to resolve the domain name to an IP address. You can also perform DNS lookups manually using command-line tools or web-based services like the ShowDNS DNS Lookup tool.
A DNS lookup typically queries a recursive resolver — a server that handles the full lookup process on your behalf and returns the final answer from the authoritative nameserver. The result may come from the resolver's cache if the record was recently fetched.
What Is an NS Lookup?
An NS lookup is a more specific operation: it queries the NS (Nameserver) records for a domain. NS records identify which nameservers are authoritative for a domain — that is, which servers hold the official DNS records.
NS lookups are most useful when you need to verify which DNS hosting provider controls a domain's records, confirm that a nameserver change has propagated, or troubleshoot delegation issues where a domain is not resolving as expected.
You can perform an NS lookup using the ShowDNS NS Lookup tool, or via the command line.
Key Differences at a Glance
| Feature | DNS Lookup | NS Lookup |
|---|---|---|
| Purpose | Query any DNS record type | Query nameserver (NS) records only |
| Scope | A, AAAA, MX, TXT, CNAME, etc. | NS records only |
| Use case | General DNS inspection and troubleshooting | Verify DNS delegation and nameserver changes |
| Queries resolver? | Yes (recursive by default) | Yes, but can query authoritative directly |
| CLI tool | dig, nslookup, host | nslookup, dig (type NS) |
The nslookup Command
The name nslookup stands for "Name Server Lookup". Despite its name, nslookup can query any DNS record type — it is not limited to NS records. It is available on Windows, macOS, and Linux and remains the most widely-used interactive DNS diagnostic tool.
# Basic DNS lookup — returns the A record for the domain
nslookup example.com
# Query a specific record type (MX records)
nslookup -type=MX example.com
# Query NS records specifically
nslookup -type=NS example.com
# Query against a specific resolver (Google Public DNS)
nslookup example.com 8.8.8.8Example output for an NS lookup:
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
example.com nameserver = a.iana-servers.net.
example.com nameserver = b.iana-servers.net.+norecurse flag with dig.The dig Command
dig (Domain Information Groper) is a more powerful DNS diagnostic tool preferred by network engineers and system administrators. It provides detailed output including TTLs, record classes, and query timing. It is available on Linux and macOS by default, and can be installed on Windows.
# General DNS lookup — A record
dig example.com A
# NS lookup — nameserver records
dig example.com NS
# Full trace — follow the delegation from root to authoritative
dig example.com A +trace
# Query a specific nameserver directly
dig example.com A @ns1.example-dns.com
# Short output (answer only)
dig example.com A +shortExample output of a dig NS lookup:
; <<>> DiG 9.18.1 <<>> example.com NS
;; ANSWER SECTION:
example.com. 86400 IN NS a.iana-servers.net.
example.com. 86400 IN NS b.iana-servers.net.
;; Query time: 45 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)When to Use a DNS Lookup
Use a general DNS lookup when you need to:
- Verify that an A or AAAA record points to the correct IP address after a migration.
- Check that MX records are configured correctly for email delivery.
- Confirm that a TXT record (SPF, DKIM, domain verification) has been published.
- Inspect a CNAME alias chain to see where it ultimately resolves.
- Confirm TTL values for planning DNS changes.
The ShowDNS DNS Lookup tool lets you query any record type from multiple geographic locations to confirm global propagation.
When to Use an NS Lookup
Use an NS lookup when you need to:
- Confirm which DNS provider currently hosts the authoritative records for a domain.
- Verify that a nameserver change (for example, moving to Cloudflare or Route 53) has propagated.
- Troubleshoot NXDOMAIN errors caused by incorrect NS delegation.
- Compare the NS records at the registrar (parent zone) against the authoritative nameserver itself to detect mismatches.
NS Delegation: Registrar vs Authoritative Nameserver
A common source of DNS problems is a mismatch between the NS records at the registrar (the "parent" zone, managed by the TLD nameservers) and the NS records published in the authoritative nameserver's own zone file.
When you change nameservers at your domain registrar, the TLD nameservers are updated to point to the new nameservers. However, if your old DNS host's zone still contains NS records pointing to themselves, this mismatch can cause resolvers to be confused about authority.
# Check NS records as seen by the TLD (parent zone) using +trace
dig example.com NS +trace
# Compare with NS records served by the authoritative nameserver itself
dig example.com NS @ns1.your-dns-provider.comDNS Lookup Tools on ShowDNS
ShowDNS provides several lookup tools depending on what you need to check:
- DNS Lookup — query any record type (A, AAAA, MX, TXT, CNAME, and more).
- NS Lookup — query nameserver records specifically.
- Check All DNS Records — view all record types for a domain in one result.
- DNS Propagation Checker — verify that a DNS change has spread to resolvers worldwide.
Frequently Asked Questions
Is nslookup the same as a DNS lookup?
The nslookup command performs DNS lookups — it can query any record type, not just NS records. The name is slightly misleading. It is a general DNS diagnostic tool, equivalent in most use cases to dig.
What is the difference between dig and nslookup?
Both tools query DNS, but dig provides more detailed output including TTLs, query timing, and full DNS response sections. It is preferred for advanced troubleshooting. nslookup is simpler and widely available including on Windows by default.
Why does my NS lookup return different results than my DNS lookup?
This can happen during a nameserver migration. An NS lookup queries the current authoritative nameservers, while a general DNS lookup may return cached results from a resolver. During a transition, these can temporarily differ. Use +trace in dig to follow the full delegation path and identify where the discrepancy occurs.
How do I check what nameservers a domain is using?
Run dig example.com NS +short or use the ShowDNS NS Lookup tool. This returns the authoritative nameservers currently configured for the domain.
Can I do a DNS lookup without using the command line?
Yes. Web-based tools like those on ShowDNS let you perform DNS lookups, NS lookups, and propagation checks without any command-line knowledge. They also query from multiple global locations, which is more useful than a local query for diagnosing propagation issues.