NS record
NS (nameserver) records name the DNS servers that hold a domain's records. They appear in two places: at the registry (set through your registrar), which sends the world to your DNS host, and inside your zone, where the DNS host lists itself. Changing nameservers moves all of a domain's DNS to a new host at once.
| Record type | NS |
|---|---|
| Type number | 2 |
| Used for | Delegation |
| How common | Everyday |
| Defined in | RFC 1035 |
Format
<name> <ttl> IN NS <nameserver>
| Field | What it means | Accepted values |
|---|---|---|
| Name | The zone being served: @ for the domain, or a subdomain being handed to other servers. | A host name. |
| TTL | How long resolvers cache the list. Parent zones usually set their own long TTL. | Seconds; 86400 (one day) is common for NS. |
| Nameserver | A server that answers for the zone. | A host name, such as ada.ns.cloudflare.com. Not an IP address, not a CNAME. |
Check an NS record
Type or paste a record in zone-file form (name, TTL, type, value) or just its value. Each part is explained as you type.
A valid NS record.
| Part | What it means |
|---|---|
| Name@ | @ means the domain itself (the root, or apex), such as example.com. |
| TTL86400 | Resolvers may keep this answer for 1 day before asking again. Changes can take that long to reach everyone. |
| ClassIN | Internet. Every record you'll write uses IN. |
| TypeNS | Nameserver for a zone. |
| Nameserverada.ns.cloudflare.com. | One of the servers that answers for this zone. The same list must be set at the registrar for the domain to use it. |
Examples
A domain on Cloudflare
@ 86400 IN NS ada.ns.cloudflare.com. @ 86400 IN NS bob.ns.cloudflare.com.
Two nameservers, as every DNS host gives at least two.
Handing a subdomain to another provider
dev 3600 IN NS ns-123.awsdns-15.com. dev 3600 IN NS ns-456.awsdns-57.net.
dev.example.com and everything under it is now answered by Route 53, while the rest stays where it is.
Glue for your own nameservers
@ 86400 IN NS ns1.example.com. ns1 86400 IN A 192.0.2.53
When a nameserver's name is inside the domain it serves, the registry also needs its address (a glue record), set at the registrar.
Registrar nameservers vs. zone NS records
The NS records that matter most are the ones at the registry: the list you set in your registrar's "Nameservers" setting. That's how resolvers find your DNS host. The NS records inside your zone should list the same servers. If the two lists disagree, some resolvers use one and some the other.
When you move DNS hosts, copy every record to the new host first, then change the nameservers at the registrar. The change takes up to the registry's NS TTL to reach everyone, often one or two days for .com.
See it on a real domain
Or use the full NS lookup.
TTL
86400 for the domain's own NS records. 3600 for delegated subdomains you may change. How TTL works
Common mistakes
- Changing nameservers at the registrar before copying records to the new DNS host, so the website and email stop working.
- Editing NS records inside the zone and expecting that to move the domain. It's the registrar setting that counts.
- Pointing NS at an IP address. Nameservers are named; their addresses come from A and AAAA (glue) records.
- Only one nameserver. Registries require at least two, ideally on different networks.
- Leaving DNSSEC on (a DS record at the registry) while moving to a host with different keys: the domain stops resolving. Turn DNSSEC off first, or move the keys.
At your DNS host
- Cloudflare, Route 53 and other hosts manage the zone's own NS records for you; you set the registry side in your registrar's nameserver setting.
- To delegate a subdomain, add NS records at that subdomain name in the parent zone.
Questions
How long do nameserver changes take?
Usually a few hours, at most about two days. Resolvers that cached the old nameservers keep using them until the TTL set by the registry runs out.
Why do I have to set nameservers at the registrar and not in DNS?
Because resolvers find your DNS host by asking the registry for your domain, and only the registrar can change what the registry says.
How many nameservers should a domain have?
At least two; most hosts give two to four. They should be on different networks so one outage doesn't take the domain offline.
This page is also available as Markdown.
Lemon Domains keeps every domain you own in one place, with expiry reminders, change monitoring and DNS editing from your AI assistant. Get started free