NS and SOA lookup
Choose the record and your tool. Query the domain itself rather than www: subdomains normally have no NS records of their own.
Only inserted into the commands in your browser.
Name servers (NS) · dig · Linux, macOS
Lists the name servers responsible for the domain. The names usually give away the DNS provider.
dig +short NS example.comns1.example.net.
ns2.example.net.Name servers (NS) · nslookup · Windows, Linux, macOS
The same lookup on Windows, Linux and macOS. Each "nameserver =" line is one NS record.
nslookup -type=NS example.comNon-authoritative answer:
example.com nameserver = ns1.example.net.
example.com nameserver = ns2.example.net.Name servers (NS) · PowerShell · Windows
The NameHost column holds the name servers. Resolve-DnsName often appends their IP addresses as extra rows.
Resolve-DnsName -Name example.com -Type NS -DnsOnlyName servers (NS) · host · Linux, macOS
The short form for Linux and macOS.
host -t NS example.comexample.com name server ns1.example.net.
example.com name server ns2.example.net.SOA · dig · Linux, macOS
+multiline labels the SOA fields and converts the seconds. The ones that matter are the serial (the zone's version) and minimum (how long "does not exist" is cached).
dig +noall +answer +multiline SOA example.comexample.com. 1800 IN SOA ns1.example.net. hostmaster.example.net. (
2026111001 ; serial
10000 ; refresh (2 hours 46 minutes 40 seconds)
2400 ; retry (40 minutes)
604800 ; expire (1 week)
1800 ; minimum (30 minutes)
)SOA · nslookup · Windows, Linux, macOS
origin is the primary name server, mail addr the address of the person responsible (the first dot stands for the @).
nslookup -type=SOA example.comNon-authoritative answer:
example.com
origin = ns1.example.net
mail addr = hostmaster.example.net
serial = 2026111001
refresh = 10000
retry = 2400
expire = 604800
minimum = 1800SOA · PowerShell · Windows
Format-List prints every field on its own line, including the primary name server and the serial number.
Resolve-DnsName -Name example.com -Type SOA -DnsOnly | Format-ListSOA · host · Linux, macOS
All seven fields on one line: primary name server, contact, serial, refresh, retry, expire, minimum.
host -t SOA example.comexample.com has SOA record ns1.example.net. hostmaster.example.net. 2026111001 10000 2400 604800 1800Ask for NS or SOA on a subdomain such as www.example.com and the answer is empty; dig shows the SOA record of the enclosing zone in the AUTHORITY section instead. That is a quick way to find where a zone starts.
What the registry has on file
Name servers are recorded in two places: the delegation at the TLD registry (set through your registrar) and the NS records inside the zone. Resolvers follow the delegation. To see it, ask a TLD server without recursion:
# find the TLD servers (here .com), then ask one of them
dig +short NS com.
dig +norecurse +noall +authority NS example.com @a.gtld-servers.netThe answer sits in the AUTHORITY section because the TLD server only refers you onward. If this list differs from what the name servers themselves return, a name server change is only half done.
Are all name servers in sync?
Every change to the zone raises the serial number in the SOA record. A name server that returns a lower serial is serving an old copy, and part of your visitors get stale answers. dig +nssearch asks every name server in turn:
$ dig +nssearch example.com
SOA ns1.example.net. hostmaster.example.net. 2026111001 10000 2400 604800 1800 from server 192.0.2.53 in 22 ms.
SOA ns1.example.net. hostmaster.example.net. 2026111001 10000 2400 604800 1800 from server 198.51.100.53 in 23 ms.The third value after SOA is the serial; it has to match on every line. On Linux and macOS host -C example.com does the same job. Providers such as Cloudflare replicate internally and always show one serial, while a classic zone transfer between primary and secondary makes any drift obvious.
When the answer is not what you expected
Likely causes:
- Different name servers than you assumed: the domain is hosted with another DNS provider, for instance after a move to Cloudflare. Records at the old host have no effect.
- Status REFUSED or SERVFAIL when you query a name server directly: it does not host the zone (lame delegation). The domain was deleted there or never set up.
- Registry and zone list different name servers: the change was not saved at the registrar, or the NS records in the zone were never updated.
- Different serials: the zone transfer to the secondary is stuck, often behind a firewall or a transfer that was never allowed.
- Only one name server: if it fails, the domain stops resolving. Many registries require at least two.
- NXDOMAIN: the domain is not registered, has expired or has no delegation.
Checking without a terminal
The name server check asks every name server for the SOA record, verifies that it answers authoritatively with the same zone version, and shows whether the servers sit in different networks. The glossary explains how name servers, registrar and registry fit together.