NS record
Learn what a DNS NS record is, how it delegates authority to name servers, why multiple are essential for redundancy, lookup methods, common setups (Cloudflare, Route 53, custom), and troubleshooting.
What Is an NS Record in DNS?
TL;DR
An NS record (Name Server) specifies the authoritative name servers for a domain.
These servers hold the official DNS records (A, MX, TXT, etc.) and answer queries for that domain.
NS records are set at your domain registrar and define who controls your DNS.
Always use at least two for redundancy.
How NS Records Work
- A resolver wants to look up
www.example.com. - It queries the root servers →
.comTLD servers. - TLD servers return the NS records for
example.com. - The resolver then queries those name servers for the actual records.
NS records create DNS delegation: handing off responsibility from parent zone to child zone. The target name servers must have their own A/AAAA records (often called glue records if they're in the same zone).
Common Use Cases
- Pointing to a DNS provider: Cloudflare, Route 53, Google Cloud DNS, etc.
- Redundancy & reliability: multiple name servers in different locations/providers
- Subdomain delegation: e.g., delegate
sub.example.comto a different set of NS - Custom/self-hosted DNS: running your own BIND, PowerDNS, etc.
- Anycast DNS: global, low-latency resolution via providers like Cloudflare
How to Lookup NS Records
dig example.com NSnslookup -type=NS example.comRecord Format
NAME TTL CLASS TYPE VALUE
example.com. 3600 IN NS ns1.example.com.- VALUE: Hostname of an authoritative name server (FQDN with trailing dot)
- Multiple records allowed (recommended: 2–4)
- Target hostnames need A/AAAA records (glue if in-zone)
Valid Examples
Basic custom
example.com. NS ns1.example.com.
example.com. NS ns2.example.com.
ns1.example.com. A 192.0.2.1
ns2.example.com. A 198.51.100.1Cloudflare
example.com. NS lara.ns.cloudflare.com.
example.com. NS pat.ns.cloudflare.com.AWS Route 53
example.com. NS ns-1234.awsdns-12.com.
example.com. NS ns-5678.awsdns-56.net.
example.com. NS ns-9012.awsdns-90.org.
example.com. NS ns-3456.awsdns-34.co.uk.NS vs Other Record Types
| Feature | NS | A / AAAA | CNAME |
|---|---|---|---|
| Purpose | Defines authoritative servers | IP address mapping | Domain alias |
| Controls DNS zone | Yes | No | No |
| Multiple allowed | Yes (recommended) | Yes | No |
| Points to | Domain name | IP address | Domain name |
| Required at registrar | Yes | No | No |
→ See also: A Record, SOA Record
Frequently Asked Questions
How many NS records should I have?
Can NS records point outside my domain?
What's the difference between NS and glue records?
Do I need to match NS at registrar and zone?
References
Related: A Record · SOA Record · DNS Basics