Nameservers are the DNS servers a registrar points a domain at, and they decide where its website and email live.
Your domain's nameservers are the setting that decides who controls its DNS. At your registrar you list two or more nameserver hostnames, such as ns1.example-host.com and ns2.example-host.com. From then on, whichever company runs those nameservers holds your domain's records and answers for it.
So if you register a domain with one company and buy hosting with another, pointing the nameservers at your host hands DNS over to the host. It can then create the records your website and email need automatically.
For how an individual nameserver answers a DNS query, see nameserver.
How to change your nameservers
The steps are similar at every registrar:
- Get the nameserver hostnames from your new host or DNS provider.
- Before switching, make sure that provider already has every record you need, including MX records for email.
- Log in to your registrar and open the domain's nameserver or DNS settings.
- Choose custom nameservers and replace the old values with the new ones.
- Save, and wait for the change to spread.
The registrar sends the update to the registry, which tells the internet which nameservers are now authoritative for your domain.
How long a nameserver change takes
Usually a few hours, and up to 24 to 48 hours. Resolvers around the world cache the old nameserver details until their time limit runs out, so some visitors see the new setup before others. Keep your old host running until the change has fully settled.
Changing nameservers vs editing DNS records
These are two different jobs, and mixing them up is the most common source of confusion.
- Changing nameservers moves your whole DNS zone to a different provider. Every record now comes from the new one.
- Editing DNS records changes individual entries, such as an A record, inside the zone at whichever provider your nameservers already point to.
If you only want to point your website at a new server and keep email elsewhere, editing the A record can be enough. Changing nameservers is simpler when one provider will handle everything.
Common nameservers mistakes
- Forgetting email. If the new DNS zone has no MX records, mail stops arriving.
- Editing records at the old provider after the nameservers have moved, so nothing changes.
- Typos in hostnames, which can take a domain offline.
- Switching to a CDN like Cloudflare without copying every record first.
- Using one nameserver. Always list at least two.