Glossary / DNS basics

Nameserver

A nameserver is a DNS server that holds the records for a domain and gives the final, authoritative answer to lookups for it. Each domain lists at least two nameservers at its registry, and changing them moves control of every record, from the website address to email routing.

Copy the syntax

See a domain's nameservers

dig example.com NS +short

Lists the authoritative nameservers the zone publishes.

See what the registry has on file

whois example.com | grep -i 'name server'

The registry copy is what resolvers follow first.

Have a name in mind?

.com $24.99 first year, renews at $24.99/yr. Other endings: not on sale yet.

In plain English

A nameserver is the server that holds your domain's settings. Whoever runs it decides where your site and email go.

What to do

  • Check which nameservers your domain uses today.
  • Copy every record before switching nameservers.
  • Change nameservers only when a provider will manage all your DNS.
Where nameservers sit in a lookupThree steps: the registry delegates example.com to two nameservers, which answer A, MX and TXT lookups.1 · Registryexample.com NSpoints to your nameservers2 · Nameserversns1 / ns2hold every record3 · AnswerA, MX, TXTreturned to resolvers
The registry tells resolvers which nameservers to ask; those nameservers hold the domain's actual records.
Defined in
RFC 1034, section 4Source: RFC 1034
Minimum per zone
At least two nameserversSource: RFC 1034
Record that lists them
NS record, type code 2Source: IANA
Glue records
Needed when a nameserver sits inside the domain it servesSource: RFC 9499
What are nameservers used for?

Nameservers decide where a domain’s traffic goes. They store the A record for the website, the MX records for email, TXT records for verification and every other record in the zone.

Pointing a domain at new nameservers hands all of those decisions to whoever runs them. That is why a hosting or email provider sometimes asks you to switch nameservers rather than add a single record.

Nameservers or DNS records: which should I change?

Change records when you only need to point the website or email somewhere new and want to keep the rest of your setup. Change nameservers when a provider will manage the whole zone for you.

Before switching nameservers, copy every existing record to the new provider. Records left behind stop working once the change takes effect.

What are custom nameservers?

Custom nameservers use your own domain in their names, such as ns1.example.com. They need glue records at the registry, because a resolver cannot look up ns1.example.com without already knowing where example.com’s nameservers are.

Nameserver records, with example values

Example NS and glue records (documentation-only names and addresses).
NameTypeValueNote
example.com.NSns1.example.net.First nameserver
example.com.NSns2.example.net.Second nameserver, separate network
ns1.example.com.A192.0.2.53Glue for a custom nameserver
ns2.example.com.A198.51.100.53Glue for the second one

How do I change a domain's nameservers?

  1. Copy every record from your current DNS provider. You have a full list of A, CNAME, MX and TXT values.

  2. Create the same records at the new provider. The new zone matches the old one.

  3. Open the domain’s settings where you registered it and replace the nameserver names. The registry now lists the new servers.

  4. Check with dig example.com NS +short from two resolvers. Both return the new names once caches expire.

Questions about Nameserver

How long does a nameserver change take?

The registry updates quickly, but resolvers keep the old NS answer until its TTL runs out. That TTL is set by the parent zone and is often longer than a normal record’s, so allow up to a day or two before every resolver sees the change.

Why do I need two nameservers?

RFC 1034 asks for at least two nameservers so a domain keeps resolving if one fails. Good practice puts them on separate networks, so one outage cannot take both down.

What is a name server versus a resolver?

A nameserver is authoritative: it holds a domain’s records. A resolver is recursive: it asks nameservers on your behalf and caches the answers. Your laptop talks to a resolver, and the resolver talks to nameservers.

Will changing nameservers break my email?

Changing nameservers breaks email only if the MX, SPF, DKIM and DMARC records are missing at the new provider. Copy them across before the switch and mail keeps flowing.

Put it to work on your own domain

See the first-year and renewal price before you pay.

.com first year$24.99, renews $24.99Check a domain
↑