DNS Fundamentals

What Is an NS Record? Understanding DNS Nameservers

Unified DNS Team · 2026-01-06 · 6 min read

Table of Contents

What Is an NS Record?

An NS record (Name Server record) specifies which DNS servers are authoritative for a domain or subdomain. When someone queries DNS for your domain, NS records tell resolvers where to find the answers.

The Basics

  • NS stands for “Name Server”
  • Delegates authority for a domain to specific nameservers
  • Every domain must have at least two NS records
  • Can be used to delegate subdomains to different nameservers
  • Critical for DNS to function

Example NS Records

; Cloudflare nameservers
example.com.    86400    IN    NS    ada.ns.cloudflare.com.
example.com.    86400    IN    NS    bob.ns.cloudflare.com.

; AWS Route 53 nameservers
example.com.    86400    IN    NS    ns-123.awsdns-45.com.
example.com.    86400    IN    NS    ns-456.awsdns-78.net.
example.com.    86400    IN    NS    ns-789.awsdns-01.org.
example.com.    86400    IN    NS    ns-012.awsdns-23.co.uk.

; Porkbun nameservers
example.com.    86400    IN    NS    maceio.ns.porkbun.com.
example.com.    86400    IN    NS    salvador.ns.porkbun.com.
example.com.    86400    IN    NS    fortaleza.ns.porkbun.com.
example.com.    86400    IN    NS    curitiba.ns.porkbun.com.

How NS Records Work

The DNS Hierarchy

DNS is hierarchical. NS records create the delegation chain:

Root (.)
    ↓ NS records point to .com servers
.com (TLD)
    ↓ NS records point to your nameservers
example.com
    ↓ Your nameservers return DNS records
DNS Response

Resolution Process

  1. Browser needs IP for www.example.com
  2. Resolver asks root servers — “Who handles .com?”
  3. Root returns .com NS records — Points to Verisign servers
  4. Resolver asks .com servers — “Who handles example.com?”
  5. TLD returns example.com NS records — Points to your nameservers
  6. Resolver asks your nameservers — “What’s the A record for www?”
  7. Nameserver returns A record — IP address returned

NS Record Structure

example.com.    86400    IN    NS    ns1.example.com.
ComponentValueDescription
Nameexample.comDomain being delegated
TTL86400Time To Live (typically high)
TypeNSRecord type
Valuens1.example.comNameserver hostname

NS Records at Registrar vs Zone

There are two places NS records exist:

At the Registrar (Upper-Level Zone)

When you register a domain, you set nameservers at the registrar. These get published in the upper-level zone (.com, .net, etc.):

; Published in .com zone by registrar
example.com.    86400    IN    NS    ada.ns.cloudflare.com.
example.com.    86400    IN    NS    bob.ns.cloudflare.com.

This is what you change when “pointing a domain” to a new DNS provider.

In Your DNS Zone

Your authoritative nameservers also contain NS records. These should match what’s at the registrar:

; In your zone file
example.com.    86400    IN    NS    ada.ns.cloudflare.com.
example.com.    86400    IN    NS    bob.ns.cloudflare.com.

Why Both Matter

  • Upper-level zone NS — How the world finds your nameservers
  • Zone NS — What your nameservers report as authoritative

If they don’t match, you may see inconsistent resolution.

Changing DNS Providers

To move from one DNS provider to another:

  1. Set up zone at new provider — Create all records
  2. Note new nameservers — Get NS values from new provider
  3. Update registrar — Change nameservers at registrar
  4. Wait for propagation — 24-48 hours for full propagation
  5. Verify resolution — Test from multiple locations

Subdomain Delegation

NS records can delegate subdomains to different nameservers:

Why Delegate Subdomains?

  • Separate management — Different teams manage different subdomains
  • Different providers — Use specialized DNS for specific services
  • Organizational separation — Divisions manage their own DNS

Example: Delegating a Subdomain

; Main domain on Cloudflare
example.com.           NS    ada.ns.cloudflare.com.
example.com.           NS    bob.ns.cloudflare.com.

; Subdomain delegated to AWS Route 53
dev.example.com.       NS    ns-123.awsdns-45.com.
dev.example.com.       NS    ns-456.awsdns-78.net.

; Subdomain delegated to Azure DNS
azure.example.com.     NS    ns1-01.azure-dns.com.
azure.example.com.     NS    ns2-01.azure-dns.net.

Setting Up Subdomain Delegation

  1. Create zone for subdomain at the delegated provider
  2. Note nameservers for the subdomain zone
  3. Add NS records in primary zone pointing to subdomain nameservers
  4. Add glue records if nameservers are within the subdomain

Glue Records

If your nameservers are within the domain they serve, you need glue records (A records alongside NS records):

; Self-referential nameservers need glue
example.com.       NS    ns1.example.com.
example.com.       NS    ns2.example.com.

; Glue records (A records for nameservers)
ns1.example.com.   A     198.51.100.1
ns2.example.com.   A     198.51.100.2

Best Practices for MSPs

1. Always Use Multiple Nameservers

Minimum two, preferably three or four:

  • Provides redundancy
  • Survives individual server failures
  • Most providers include multiple nameservers

2. Use Geographically Distributed Nameservers

Major DNS providers automatically provide this:

  • Cloudflare: Global anycast network
  • Route 53: Multiple global locations
  • Reduces latency for DNS resolution

3. Keep NS Records Consistent

NS records in your zone should match the registrar:

# Check NS at registrar (upper-level zone)
dig NS example.com @g.gtld-servers.net

# Check NS in your zone
dig NS example.com @ada.ns.cloudflare.com

4. Use High TTLs for NS Records

NS records rarely change. High TTLs (86400 = 24 hours) are appropriate:

  • Reduces DNS query load
  • Improves caching
  • Lower TTL before planned changes

5. Document DNS Provider Details

For each domain, track:

  • Current DNS provider
  • Nameserver values
  • Registrar where NS is configured
  • Any subdomain delegations

6. Test Before Switching Providers

Before changing nameservers:

  1. Verify all records exist at new provider
  2. Test resolution using new nameservers directly
  3. Lower TTLs 24-48 hours before switch
  4. Make the switch and monitor
# Test records at new provider before switching
dig @new-ns1.provider.com example.com A
dig @new-ns1.provider.com example.com MX
dig @new-ns1.provider.com example.com TXT

Frequently Asked Questions

How many NS records should I have?

Minimum two, recommended three to four. More provides better redundancy, but returns diminish after four or five.

Can I use nameservers from different providers?

Technically yes, but it requires careful management. Both providers need identical zone data, and changes must be synchronized. Most MSPs stick with a single provider.

What’s the difference between registrar and nameserver?

  • Registrar — Where you registered/purchased the domain (GoDaddy, Namecheap, Porkbun)
  • Nameserver — DNS servers that host your DNS records (can be same company or different)

How long does it take to change nameservers?

Propagation typically takes 24-48 hours, though most resolvers update within a few hours. The delay is due to TTL caching at various levels.

What happens if all nameservers are down?

The domain becomes unresolvable. Cached responses continue working until their TTL expires, then all services depending on DNS fail (website, email, etc.).

Can NS records point to IP addresses?

No, NS records must point to hostnames. If the hostname is within the same domain (ns1.example.com for example.com), you need glue records.


Get Started with Unified DNS

Nameserver management across multiple registrars and DNS providers is complex. Unified DNS lets you view, modify, audit, and backup all your DNS configurations — with automated backups and Hudu syncing so your documentation stays current across every provider change.

Unified DNS is live — try it free for a month with code FREETRIAL2026 at billing setup. No commitment. Or request a demo for a walkthrough.