Record type reference
NS Record
An NS (name server) record names a server that is authoritative for a zone. NS records in the parent zone delegate the domain, and NS records in the zone itself confirm which servers answer for it.
NS record at a glance
| Field | Value |
|---|---|
| Type code | 2 |
| Defined in | RFC 1035, section 3.3.11 |
| Value | One name server hostname, such as ns1.example.net. |
| Allowed at the apex | Required there; also used at any delegated subdomain |
| Target rules | A hostname with A or AAAA records; never an IP address or a CNAME |
Here is how an NS record looks in a zone file:
example.com. 86400 IN NS ns1.example.net.
example.com. 86400 IN NS ns2.example.org.
Two or more name servers on different networks is the long-standing advice of RFC 2182, so one outage cannot take the whole domain offline.
Two copies: parent and child
NS records exist in two places. The parent zone (for example.com, that is the .com registry) holds a copy that you set at your registrar. This is the delegation: resolvers follow it to find your servers. Your own zone holds a second copy at the apex, which those servers return when asked directly.
The two sets should match. When they differ, resolvers may use either list depending on what they cached, so a server that appears in only one copy gets some traffic and not the rest. After moving DNS providers, the most common leftover is a registrar delegation that still lists an old provider. Moving DNS providers gives the safe order of steps.
Glue records
If a zone's name servers sit inside the zone, such as ns1.example.com serving example.com, a resolver could not look up their addresses without already knowing them. The parent breaks the loop by publishing glue: A and AAAA records for those name servers alongside the delegation. You set glue at your registrar, often called "host records" or "child name servers". Delegation and glue records covers the details.
Lame delegation
A delegation is lame when a listed name server does not answer authoritatively for the zone: it refuses, times out, or answers without the authoritative flag. Resolvers retry another server, so users see slow lookups rather than failures, until every listed server is lame. Lame delegation explains how to find and fix it.
How to look up an NS record
Each tool below sends the query to your default resolver unless you name a server. Swap in your own domain for example.com, and add a public resolver such as 1.1.1.1 to compare answers with what your network sees. To see the parent copy, ask a server for the parent zone, such as a.gtld-servers.net for .com.
dig (macOS, Linux, WSL)
| Command | What it does |
|---|---|
| dig example.com NS | The NS set your resolver has, normally the child copy |
| dig +short example.com NS | Only the name server names |
| dig example.com NS @a.gtld-servers.net +norecurse | The parent copy: the delegation the .com registry publishes, with glue |
| dig @ns1.example.net example.com NS +norecurse | The child copy, straight from one of your name servers |
| dig +trace example.com NS | Walk the delegation from the root down |
nslookup (Windows, macOS, Linux)
| Command | What it does |
|---|---|
| nslookup -type=NS example.com | Name servers from your default DNS server |
| nslookup -type=NS example.com a.gtld-servers.net | The delegation as the .com servers publish it |
| nslookup -type=SOA example.com ns1.example.net | Confirm a listed server answers for the zone |
PowerShell (Windows)
| Command | What it does |
|---|---|
| Resolve-DnsName -Name example.com -Type NS | NS records; the server names are in the NameHost column |
| Resolve-DnsName example.com -Type NS -Server a.gtld-servers.net -NoRecursion | The parent copy, without asking that server to recurse |
| Resolve-DnsName example.com -Type SOA -Server ns1.example.net -NoRecursion | Check that one name server answers for the zone |
A parent server answers an NS question with a referral, so the records appear in the authority section rather than the answer. dig prints them under AUTHORITY SECTION, and that is expected.
Common mistakes
- Registrar and zone NS sets that differ. Update both when you add or remove a provider.
- A single name server, or two on the same network. One failure takes the domain offline.
- NS pointing at a CNAME. Forbidden by RFC 2181 section 10.3.
- Stale glue after renumbering a name server. The parent keeps handing out the old address until you update the host record at the registrar.
- Delegating a subdomain to a provider account you later delete. The NS records stay and can be claimed; see dangling DNS.
NS records in Domain Visualizer
Domain Visualizer looks up the apex NS set on every scan and resolves each name server to its addresses. The detail panel lists each server, which makes a single-provider or single-server setup easy to spot.
FAQ
How many NS records should a domain have?
At least two, on different networks. Many registries require two. More than four rarely adds resilience and makes every change harder to keep in sync.
Why do my registrar and DNS provider show different name servers?
They are separate copies. The registrar sets the delegation in the parent zone and the DNS provider publishes the NS set inside your zone. Update the registrar to match the provider.
What TTL do NS records use?
The parent zone sets the TTL on the delegation, often one or two days for .com. Your own zone sets the TTL on its copy. Expect NS changes to take up to the longer of the two to reach every resolver.
Sources and further reading
- RFC 1034: Domain Names, Concepts and Facilities: section 4.2 on zones and delegation
- RFC 2182: Selection and Operation of Secondary DNS Servers
- RFC 2181: Clarifications to the DNS Specification: section 10.3 on NS targets
- BIND 9 manual: dig
- Microsoft Learn: nslookup
- Microsoft Learn: Resolve-DnsName