What is a nameserver?

Nameservers hold your domain’s DNS records. Changing them moves control of every record to a new provider at once.

3–4 minutes
Coiled green network cable on a white background

A nameserver is a server that stores a domain’s DNS records and answers questions about them. When anyone looks up example.com, the final answer comes from that domain’s authoritative nameservers.

Where nameservers are set

At your registrar. The registrar passes the list to the registry for your domain ending (such as .com), which tells the whole internet “for example.com, ask these servers”. You will usually see two to four names, such as ns1.provider.net and ns2.provider.net.

Changing nameservers versus changing records

You changeWhat movesTypical wait
A recordWhere the website pointsMinutes to hours (the TTL)
NameserversWho controls every recordUp to 48 hours

Changing nameservers hands the whole zone to a new provider. Any record not recreated there disappears, including email (MX) and verification (TXT) records. Before switching:

  1. List every record at the current provider. Many panels have an export option.
  2. Recreate them all at the new provider.
  3. Only then change the nameservers at the registrar.

Check which nameservers a domain uses

dig NS example.com +short
whois example.com

dig asks DNS; whois shows what the registry has on file. During a change they can briefly disagree.

Should you use your host’s nameservers?

Many hosts ask you to point your domain’s nameservers at them. It is convenient, but think about what else depends on the domain.

Use the host’s nameservers when the domain is new, the host also provides your email, and you want one place to manage everything.

Keep DNS elsewhere when email is with a separate provider, you use services that need DNS records (verification, mail authentication, other subdomains), or you might change host later. Keeping DNS at your registrar or a dedicated DNS provider means a future move is one A record change, instead of rebuilding the whole zone at a new host.

Dedicated DNS providers, including free tiers from Cloudflare and others, are usually faster and more reliable than a registrar’s or a small host’s nameservers, and add features such as change history and DNSSEC.

Glue records and custom nameservers

Some hosts and resellers use nameservers named after their own domain, such as ns1.example-host.com. That creates a loop: to find ns1.example-host.com, you would need to ask example-host.com‘s nameservers, which are ns1.example-host.com. Glue records break the loop. They are IP addresses for those nameservers, registered at the registrar and published by the registry alongside the NS records.

You only need glue records if you run nameservers under your own domain. They are set at the registrar, usually under “child nameservers”, “host records” or “register nameservers”. Check them with:

dig NS example-host.com @a.gtld-servers.net

The IP addresses in the ADDITIONAL section of the answer are the glue.

Common problems

  • Lame delegation. The registrar lists nameservers that do not actually have your zone, often after cancelling a DNS service. Lookups fail or time out. Fix the nameserver list at the registrar, or recreate the zone on those servers.
  • Mismatched nameservers. The NS records inside your zone list different servers from the registrar. The registrar’s list is the one that counts; make the zone match it.
  • Only one nameserver. If it goes down, the domain disappears. Always use at least two, ideally on different networks.

Test how each of your domain’s nameservers answers:

for ns in $(dig NS example.com +short); do echo "$ns: $(dig example.com A @$ns +short)"; done

Every nameserver should return the same answer.

Running your own

Your host or DNS provider normally runs the nameservers for you. Running your own is possible but rarely worth it: nameservers need to be reliable, spread across networks and protected from attacks, because if they fail, the whole domain stops resolving.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.