Skip to content
hostcomplex

NS Record

Maarten Soetens 3 min read

What an NS Record Does

An NS record, short for nameserver record, names a server that is authoritative for a zone. It is the DNS entry that says, in effect, that answers for this domain come from these servers. NS records are how DNS passes responsibility for a domain from one level of the hierarchy to the next, a process called delegation. The wider structure is described in the DNS hierarchy.

Each delegated zone has NS records in two places. The parent zone, run by the registry for the top-level domain, holds the delegation. The domain's own zone also lists its nameservers at its apex, as the authoritative set for the domain. Resolvers use the parent copy to find the servers, and the zone's own copy confirms the same servers.

How Delegation Works Between Parent and Child

Delegation works in two steps. When a resolver asks the top-level domain's servers about example.com, the answer is a referral: NS records that name the domain's nameservers. The resolver then asks one of those servers for the actual records. A typical delegation line in a parent zone looks like this:

example.com. 172800 IN NS ns1.provider.example.

The NS set at the parent and the NS set in the domain's own zone should match. When they disagree, the answers a visitor gets can depend on which server responds, and problems can appear only some of the time. This is a frequent cause of trouble after a change of DNS provider.

NS Records When You Change DNS Providers

Changing DNS providers means changing NS records in two places. At the registrar, you replace the nameservers, which updates the delegation in the parent zone. Inside your new provider, the zone must list the same nameservers. Until caches expire, some visitors may still reach the old servers.

For this reason, many owners keep the old provider running until the change has spread. Stopping the old servers too early can make the site unreachable for anyone whose resolver still holds the previous delegation. The timing is governed by the TTL on the records involved, which is explained in what TTL is.

Frequently asked questions

Is an NS Record the Same as a Nameserver?

They are closely related but not identical. A nameserver is a server that answers DNS queries for a zone. An NS record is the DNS entry that names that server as authoritative. In everyday speech people use the two terms interchangeably, and the nameservers article covers the everyday meaning in more detail.

How Many NS Records Should a Domain Have?

At least two. The DNS standard recommends at least two nameservers, ideally in different locations, so that the domain keeps working if one server fails. Many providers publish more. Every NS record should point to a server that actually holds the zone, because a listed server that does not answer can slow lookups.

  • Two-Factor Authentication

    Two factor authentication hosting adds a second check to control panel, domain and CMS logins. Learn which methods are strongest and why 2FA helps.

  • What Is an A Record?

    What is an A record? Learn how this DNS record maps a hostname to an IPv4 address, why domains use several A records and the root and www pattern.

  • Billing and Automation Platforms

    What is WHMCS? Learn how this commercial billing and automation platform helps hosts sell plans, collect payments and create accounts automatically.