What Are Nameservers? And How to Change Them Safely
Quick answer
Nameservers are the servers that hold your domain's DNS records and answer questions about them, such as which IP address your website uses. Your registrar tells the internet which nameservers your domain uses. Changing nameservers moves control of all your DNS records to a different provider, such as your host or Cloudflare.
What nameservers do
Every domain needs somewhere to keep its DNS records: the A record for your website, the MX records for your email, TXT records for verification and so on. That place is your domain’s authoritative nameservers.
Nameservers usually come in sets of two or more and look like this:
ns1.registrar-example.com
ns2.registrar-example.com
When someone visits your site, their resolver asks the registry for your extension (such as .com) which nameservers your domain uses, then asks those nameservers for the record it needs.
Nameservers vs. DNS records
This is the distinction that confuses most people:
| Nameservers | DNS records | |
|---|---|---|
| What they are | The provider that hosts your DNS | The individual entries inside it |
| Where you set them | At your registrar | At whichever provider your nameservers point to |
| Examples | ns1.host.com, ns2.host.com | A, CNAME, MX, TXT |
| Effect of changing | Moves all DNS control to a new provider | Changes one thing, such as where your site lives |
A simple way to think of it: nameservers decide which address book the internet reads; DNS records are the entries in that book.
If you edit records at your registrar but your nameservers point to Cloudflare, nothing will change, because the internet is reading Cloudflare’s copy.
Where your nameservers might point
- Your registrar (the default). Simple, and keeps your domain and DNS in one place.
- Your host or website builder. Some platforms ask you to switch so they can manage records for you.
- A dedicated DNS provider, such as Cloudflare. Often chosen for speed, extra features or a CDN.
There’s no single right answer. What matters is knowing which one you’re using.
How to check your current nameservers
- Run an ICANN lookup on your domain and look for the Name Servers section.
- Or use a terminal:
dig example.com NS +shortornslookup -type=ns example.com. - Or check your registrar’s domain settings page.
How to change nameservers
Changing nameservers is safe if you prepare first. The main risk is losing records, especially email ones, that exist only at the old provider.
- Export or screenshot your current DNS records at the old provider. Note every A, CNAME, MX and TXT record.
- Add your domain at the new provider. It will give you its nameserver names, usually two.
- Recreate your records at the new provider. Some providers scan and import existing records automatically; check that they’re complete, especially MX, SPF, DKIM and DMARC.
- Turn off DNSSEC at your registrar if it’s enabled, unless the new provider gives you instructions for moving it. Mismatched DNSSEC settings can make your domain stop resolving.
- Log in to your registrar and find the nameserver setting (often called Nameservers, DNS servers or Custom DNS).
- Replace the old nameservers with the new ones, exactly as given. Remove any old entries.
- Save and wait. Check progress with a lookup tool. Keep the old DNS zone in place for a few days in case any resolvers still use it.
- Re-enable DNSSEC through the new provider if you use it.
How long does it take?
Changes to individual records are often visible within minutes to hours. Nameserver changes are slower, because the registry’s records about your domain can be cached for longer; allow up to 24 to 48 hours, though many changes are visible sooner. During that window, some visitors may get answers from the old provider and some from the new one, which is why matching records at both is important. See what DNS propagation is.
Changing nameservers vs. adding records
Many website builders offer two ways to connect your domain:
| Method | What you do | Pros | Cons |
|---|---|---|---|
| Change nameservers | Point your domain’s nameservers to the platform | One step; platform manages records | All DNS, including email, moves to the platform |
| Add DNS records | Keep current nameservers and add A/CNAME records | You keep control; email untouched | A few more steps |
If you already have email working on your domain, adding records is often the lower-risk choice. Our guide on how to connect a domain to a website walks through both.
Common nameserver problems
- Typos in nameserver names. A single wrong letter can take your domain offline.
- Email stopped after switching. Your MX records weren’t copied. Add them at the new provider.
- “Domain not active” at the new provider. The registrar change hasn’t been saved, or hasn’t been picked up yet.
- Only one nameserver entered. Add all the ones your provider gives you.
Custom (vanity) nameservers
Some hosts let you use nameservers on your own domain, such as ns1.example.com. These need extra “glue” records at your registrar. They’re mostly used by hosting resellers and aren’t needed for a typical website.
If you’re still choosing where to buy, see how to buy a domain name.
Frequently asked questions
How long does a nameserver change take?
Often within a few hours, but allow up to 24 to 48 hours. The registry's record of your nameservers can be cached by resolvers for a day or more.
Will changing nameservers affect my email?
It can. Your MX and email authentication records live at the old provider. If you don't recreate them at the new one before switching, email can stop arriving.
Do I need to change nameservers to connect a website builder?
Usually not. Most builders also let you keep your current nameservers and add A or CNAME records instead. Changing nameservers is simpler but hands all your DNS to that platform.
Why are there always at least two nameservers?
For reliability. Registries generally require two or more, ideally on separate networks, so your domain still resolves if one is unavailable.
Sources