What is an NS Record?
An NS record (Nameserver record) indicates which DNS servers are authoritative for a domain. It tells the rest of the internet where to go to find the other DNS records (like A or MX) for that domain.
Structure of an NS Record
example.com. 86400 IN NS ns1.nameserver.com.
- Host: The domain being delegated.
- TTL: Usually higher (e.g., 86400 seconds / 1 day).
- Type:
NS. - Value: The hostname of the nameserver.
How Delegation Works
DNS is a hierarchical system. When you register a domain, the TLD (Top-Level Domain) servers (like the .com servers) store NS records pointing to your chosen DNS provider's nameservers.
- User looks up
example.com. - Root servers point to
.comTLD servers. .comservers return your NS records (e.g.,ns1.provider.com).- User then asks
ns1.provider.comfor theArecord ofexample.com.
Best Practice: Multiple Nameservers
You should always have at least two NS records pointing to different physical locations. Most DNS providers give you 2 to 4 nameservers. This provides redundancy; if one nameserver is down, the others can still handle requests.
Subdomain Delegation
You can also use NS records to delegate a subdomain to a different set of nameservers. This is common in large organizations where different teams might manage their own subdomains (e.g., engineering.example.com).
Glue Records
If your nameservers are subdomains of the domain they manage (e.g., ns1.example.com managing example.com), you need Glue Records. Glue records are A records for the nameservers stored at the registrar to break the circular dependency.