Skip to content
Search

Search this site

NS Records and Nameservers Explained

An NS record names a server that is authoritative for a domain. The set of NS records for a zone lists the nameservers that hold its DNS records, and changing them at the registrar hands the domain to a different DNS provider. NS targets must be real host names, never aliases.

An aisle between black server racks in a small server room with blurred indicator lights

Section of: DNS Records Explained: Types and Examples

An NS record tells the DNS which servers are in charge of a domain. It is one of the types in DNS records explained, and it is the record that decides where all the others live.

What an NS record does

RFC 1035 defines the NS record as a host that should be authoritative for the specified domain. “Authoritative” means the official source: a name server is an authority for the parts of the name space it holds. RFC 2181 adds that the authoritative servers for a zone are enumerated in the NS records at the origin of the zone.

example.com.   86400  IN  NS  ns1.dnsprovider.example.
example.com.   86400  IN  NS  ns2.dnsprovider.example.

A resolver follows delegation from the root to the .com servers to the domain's nameservers

Nameservers vs resolvers

Two different programs are easy to confuse. RFC 1034 describes name servers as programs that hold information about the domain tree and resolvers as programs that extract that information from name servers on behalf of clients. Your computer asks a resolver; the resolver asks nameservers. NS records are what let a resolver find the right ones.

Delegation: how a domain reaches its nameservers

The domain tree is divided into zones. RFC 1034 says that after all the cuts in the name space are made, each group of connected name space is a separate zone. The parent zone points to the zone below it by naming its nameservers. In practice that means the parent zone, for example the one for .com, points to the nameservers you have chosen for your domain. When you set nameservers at your registrar, you are setting that delegation.

The same mechanism lets you hand a subdomain to different servers: an NS record at a subdomain delegates it elsewhere. Cloudflare notes you only need NS records for subdomain setups or for delegating subdomains outside Cloudflare.

Rules for NS records

  • Point to host names with addresses. RFC 2181 says an NS target must not be an alias, so never use a CNAME as a nameserver.
  • Use at least two. Two or more nameservers keep the domain resolvable if one fails.
  • Do not overdo it. Cloudflare supports up to 10 NS records per delegation name and recommends seven or fewer.
  • Keep the set consistent. Every nameserver in the set should serve the same records.

Find the nameservers of a domain

Choose the NS type in the DNS lookup tool and enter the domain. The result lists the nameserver names. From a terminal, the commands in nslookup and dig do the same. Registration data from the WHOIS lookup tool may also list nameservers, but that is the registry’s copy and can briefly differ from what the zone says.

Change nameservers safely

  1. At the new DNS provider, create the zone and recreate every record, including A, MX and TXT records, such as the mail-authentication entries.
  2. Compare the old and new zones side by side.
  3. At the registrar, replace the nameservers with the new ones.
  4. Keep the old zone running until caches have expired, then check with the lookup tool.

Moving a registration to a different registrar is a separate step; see how to transfer a domain and keep DNS working while you do it.

Common mistakes: switching nameservers before copying the records, using a CNAME as a nameserver, and forgetting email records during the move.

Reading the answer

A lookup of the NS type returns host names, not addresses. If you see two or more names on the same provider’s domain, the zone is hosted there. If the names differ from what your registrar shows, a change may still be in progress, or the registry’s copy has not caught up. When a name does not resolve at all, check the NS records first: if the nameservers named there do not answer, no record in the zone can be reached, however correct it is.

Questions to ask your DNS provider

  • Which exact nameserver names should I enter at my registrar?
  • Do I need to create the zone before I change nameservers?
  • Does the provider copy existing records, or do I enter them by hand?

Record check: claims compared with the cited IETF and Cloudflare documents on 2026-11-18; see the editorial policy.

Frequently asked questions

What is an NS record?

An NS record names a host that is authoritative for a domain, meaning its answers are the official ones. RFC 1035 defines it as a host which should be authoritative for the specified class and domain. A domain normally has two or more NS records for resilience.

What is a nameserver?

A nameserver is a server program that holds DNS information for part of the domain tree and answers queries about it, per RFC 1034. When it is the official source for a domain it is called authoritative. Your DNS provider runs the nameservers for your zone.

How do I find the nameservers of a domain?

Look up the NS records of the domain with a DNS lookup, or with the dig or nslookup commands. The answer lists the nameserver host names. The WHOIS or RDAP record may also show them, but the DNS answer is what resolvers actually use.

How do I change nameservers?

Enter the new nameserver host names in the domain settings at your registrar, after setting up the zone and its records at the new DNS provider. Copy the records first, because the name stops using the old servers once the change takes effect and caches expire.

Can a nameserver be a CNAME?

No. RFC 2181 says the target of an NS record must not be an alias, so a nameserver name cannot be a CNAME. Each NS record must point at a host name that has its own address records, which your DNS provider normally supplies.

Sources and further reading

  1. RFC 1034: Domain names, concepts and facilities (rfc-editor.org)
  2. RFC 1035: Domain names, implementation and specification (rfc-editor.org)
  3. RFC 2181: Clarifications to the DNS specification (rfc-editor.org)
  4. Cloudflare: DNS record types (developers.cloudflare.com)

You might also like

  • DNS Records Explained: Types and Examples

    What DNS records are, how a lookup finds them, and what A, AAAA, CNAME, MX, TXT, NS and SOA records do, with examples and common mistakes.

  • A Record vs CNAME: Which to Use

    A record vs CNAME compared: what each does, the rules that separate them, why a CNAME cannot sit at the root, and a simple way to choose between them.

  • DNS A Record Explained

    A DNS A record maps a name to an IPv4 address. See its fields, example records, how multiple A records behave, TTL, and how to troubleshoot.

  • DNS AAAA Record: IPv6 Explained

    A DNS AAAA record maps a name to an IPv6 address. See the format, how it differs from an A record, when to add one, and how to test it.

  • DNS CNAME Record Explained

    A DNS CNAME record makes one name an alias of another. Learn the rules, why it cannot sit at the root, CNAME vs A record, and how to fix conflicts.

  • DNS MX Record Explained

    A DNS MX record names the mail exchange for a domain and a priority number. Learn how lower values win, why MX cannot be an IP, and null MX.

Top of page