All articles
165 articles · updated weekly See our Tools
All articles
Comparisons

Nameserver vs DNS Zone: The Difference and Why Email Breaks

A nameserver is the server that answers for a domain; the DNS zone is its set of records. Switch nameservers without copying the zone and email goes down.

Nameserver vs DNS Zone: The Difference and Why Email Breaks
COVER · Comparisons

I switched a domain's nameservers on a Friday night (classic mistake) and by the next morning email had stopped. The site was still up, but no messages were coming in. The domain was fine, DNS "had been configured", and something still broke. The new nameserver itself wasn't the problem: I had moved the place where the DNS zone is read without bringing along the records that lived in the old zone.

Control panels blur the two concepts all the time, and registrars often call nameservers "DNS servers". This post separates them: what a nameserver is, what a DNS zone is, how one delegates to the other, and why changing the first takes email down. The step-by-step of pointing a domain at a host, with measured propagation times, is in the companion post how to point a domain to your hosting; here the focus is the concept and migrating without losing records.

Nameserver: the server that answers for the domain

A nameserver (or DNS server, as many registrar panels label it) is the server with authority to answer queries for a domain. When a resolver wants the IP of example.com, the final answer comes from that domain's authoritative nameserver. The names usually look like ns1.provider.com and ns2.provider.com.

The nameserver is not your data. It's the address where the data lives. Changing the nameserver tells the world: "from now on, ask about this domain over there". Whatever exists over there is your problem.

Why do they always come in pairs? RFC 1034 (section 4.1) says every zone must be available on at least two servers, "by administrative fiat", and RFC 2182 notes that domain registration rules require the same minimum (and recommends three for organization-level zones). Technically, a domain with a single nameserver resolves; it just has no redundancy, and the registrar usually won't even let you save it that way.

DNS zone: the set of records

The DNS zone is the content: every record of the domain. That's where the A (IPv4), AAAA (IPv6), CNAME (alias to another name), MX (where email goes), and TXT records (SPF, DKIM, DMARC, Google verification and friends) live, along with the SOA and the NS records themselves. What each type does is covered in DNS record types; here a whole zone is enough:

$ORIGIN example.com.
@       3600  IN  SOA   ns1.provider.com. admin.example.com. (2026110901 7200 3600 1209600 3600)
@       3600  IN  NS    ns1.provider.com.
@       3600  IN  NS    ns2.provider.com.
@        300  IN  A     203.0.113.10
www      300  IN  CNAME example.com.
@       3600  IN  MX    10 mx.email-provider.com.
@       3600  IN  TXT   "v=spf1 include:_spf.email-provider.com ~all"
sel1._domainkey 3600 IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."

The relationship fits in one sentence: the nameserver is the server; the zone is what it serves. A nameserver without your zone has nothing to answer, and a zone that no delegated nameserver hosts is never queried by anyone.

Delegation: how the world finds out who's in charge

Your registrar has a nameservers field. Whatever you put there is published in the TLD zone (.com, .br) as NS records, and it works like a road sign: "for this domain, ask these servers". You can see the sign by asking the TLD server directly, with no cache in between:

$ dig uol.com.br NS @a.dns.br +norec
;; AUTHORITY SECTION:
uol.com.br.   3600  IN  NS  eliot.uol.com.br.
uol.com.br.   3600  IN  NS  borges.uol.com.br.
uol.com.br.   3600  IN  NS  charles.uol.com.br.

(Real output, queried on November 9, 2026.) Note the section: AUTHORITY, not ANSWER. The .br server doesn't know the IP of uol.com.br; it only knows who does. The full path of a query, from the root to the authoritative server, is in how a DNS query works.

That's where the two places where you "change DNS" come from, and they're not the same thing:

  • Registrar (where you registered the domain): sets which nameservers the domain is delegated to.
  • DNS provider (the registrar itself, your host, Cloudflare, Route 53): stores the zone and answers queries.

They can be the same company, and often are, which makes the confusion worse. If the nameservers point to Cloudflare, editing the zone in the registrar's panel changes nothing: that zone still exists, it's just that nobody asks it anymore.

Why email goes down when you change the nameserver

That's exactly what happened on my Friday night. When you change the nameservers, the zone that counts is the new provider's. It may be empty, hold only the default records the provider creates, or be a partial copy. Some providers scan your current DNS and import records when you add the domain; Cloudflare does this, but its own documentation warns that the scan is based on common record names and isn't guaranteed to find everything. A DKIM selector with a custom name, like sel1._domainkey, is exactly the kind of record that gets left behind.

Without the MX, anyone trying to email you can't find your mail server. Worse: under RFC 5321 (section 5.1), when a domain has no MX, the sender tries to deliver to the domain's own address (the A record), which is now the web server, which doesn't accept mail. Without SPF and DKIM, what you send starts landing in spam or getting rejected. The site stays up, because the A record was the only thing you remembered to create.

Then there's the transition. The delegation in the TLD has its own TTL, from hours to two days depending on the TLD (the measured numbers are in the pointing guide). During that window, some resolvers still query the old nameservers and some already query the new ones. If you deleted the old zone, or closed the account, whoever is still on the old cache gets no answer either. Both sides have to be correct at the same time.

How to migrate the zone without breaking anything

There's one rule: the new zone must be complete before you change the delegation. In practice:

  1. Export the old zone. Many panels can export a zone file (BIND format). If yours can't, list everything on screen. Don't rely on dig ANY or a zone transfer (AXFR): RFC 8482 lets servers answer ANY with a minimal response, and AXFR is almost always refused to anyone who isn't a secondary server. I asked Cloudflare's nameservers for an AXFR of one of my domains and got Transfer failed.
  2. Recreate everything at the new provider, paying attention to what scans tend to miss: MX, SPF and DMARC TXT records at the apex, DKIM under selector._domainkey, subdomains, and the AAAA if there is one.
  3. Compare both zones by asking each nameserver directly, before the switch. At most providers, the new nameserver already answers for the zone as soon as you add the domain, even before the delegation points to it:
# what the old zone answers
dig @ns1.old-provider.com example.com MX +short
dig @ns1.old-provider.com example.com TXT +short

# what the new zone will answer after the switch
dig @ns1.new-provider.com example.com MX +short
dig @ns1.new-provider.com example.com TXT +short

If the new zone returns nothing where the old one has an MX, you've just avoided my Friday.

  1. Change the nameservers at the registrar and keep the old zone intact for at least a few days, until the delegation TTL has expired everywhere.

One more test is worth doing for the AAAA: open What Is My IP and see whether your connection goes out over IPv6. If it does, your browser will follow the new zone's AAAA; if you forgot to copy it, or copied a stale one, IPv6 is where the problem shows up first, and only for people who have IPv6.

Frequently asked questions

Does changing the nameserver delete my records?

It doesn't delete the old provider's records: they stay there as long as the account exists. But they stop being queried, because questions now go to the new nameserver and its zone. In practice it's the same as losing them. Recreate the zone at the destination before changing the delegation.

Can I edit the zone without changing the nameserver?

Yes, and most of the time that's what you want. If the zone is already hosted where you need it, just edit the records there (add an A, change the MX). Changing the nameserver only makes sense when you want to change which provider hosts the zone.

What's the difference between a registrar and a DNS provider?

The registrar is where you register and renew the domain and set the nameservers. The DNS provider hosts the zone and answers queries. They can be the same company, but registering in one place and hosting the zone somewhere else is common.

How long does a nameserver change take to apply?

It depends on the delegation TTL in the TLD and on each resolver's cache: from minutes to about two days. During the transition both zones get queried, so both need to be right. The measured times for .com.br and .com are in the pointing guide.

Nameserver says where, zone says what

A nameserver is the address of the authority; a DNS zone is the content that authority serves. The registrar points to the nameserver, the DNS provider stores the zone. Changing nameservers changes where the zone is read, it doesn't copy anything: build the new zone in full, compare with dig directly against both nameservers, and only then switch the delegation, keeping the old zone alive until caches expire. And don't change nameservers on a Friday night.

RD
Author
Rafael Duarte
Backend developer with a background in fintech and B2B SaaS — worked on teams that scaled APIs from zero to millions of requests. Carries enough production scars to hold strong opinions on tools, patterns and architecture decisions. Not an academic: he read the UUID RFC when he had to choose between v4 and v7 for a write-heavy table.
View profile