designwithfocus

Domains, hosting & DNS

Nameserver vs CNAME: Delegation and an Alias Are Different

By Design With Focus Team 7 min read
Two DNS rows on a screen, one NS delegation and one CNAME alias

Short answer

A nameserver delegates a DNS zone, and a CNAME only aliases one name to another. The nameserver is the host that answers for the zone. The CNAME marks its owner as an alias and stores the canonical name. You change nameservers at the registrar. You add a CNAME inside a zone you already control. Mixing them up is how sites lose DNS or publish an alias where a delegation was required.

Last verified against the sources listed below.

Key takeaways

  • A nameserver is authoritative for a domain. Cloudflare describes it as the server that holds the definitive DNS records.
  • RFC 1034 defines CNAME as the canonical name of an alias. If a CNAME is present, no other data should be at that name.
  • IANA lists NS as type 2 and CNAME as type 5. NS data is a host name. CNAME data is a domain name.
  • Change nameservers when you move DNS hosting. Add a CNAME when one hostname should follow another hostname.
  • As of December 2026, Cloudflare allows up to 10 NS records on one delegation name and says to keep the set at seven or fewer.
  • RFC 1912, from February 1996, calls NS records that point at a CNAME a configuration error.

Nameserver vs CNAME is a comparison of two DNS records that do different jobs. One delegates the zone. The other aliases a single name. They are not two labels for the same setting.

You meet both while moving a site to web hosting or pointing a hostname at a service. The registrar, the DNS host, and the zone file are three different screens. The record you edit depends on which screen you are on.

What does a nameserver do?

A nameserver answers DNS queries for the zones it is authoritative for. Cloudflare’s nameserver docs describe those servers as the ones that hold the definitive records and give the final response.

MDN’s DNS glossary calls DNS a hierarchical naming system that stores names with resources such as IP addresses. The nameserver is where that answer is supposed to come from for your zone.

As of December 2026, Cloudflare assigns two standard nameservers for a primary or secondary zone unless a zone default says otherwise. Those names use the pattern of a name on ns.cloudflare.com. Enterprise Foundation DNS can assign three advanced nameserver names instead. A zone uses one nameserver configuration at a time.

The addresses on those nameservers are static and do not change without notice. For them to be authoritative, you update the nameservers where the domain is registered. Cloudflare Registrar domains already use Cloudflare nameservers. Moving them to another DNS host means transferring the domain away.

What does a CNAME record do?

A CNAME marks one name as an alias of another name. RFC 1034, section 3.6.2, says the owner is the alias and the RDATA is the canonical name.

IANA’s DNS parameters list NS as type 2, an authoritative name server, and CNAME as type 5, the canonical name for an alias. RFC 1034 says NS data is a host name and CNAME data is a domain name.

If a CNAME is present at a node, no other data should be present. That rule keeps the alias and the canonical name from disagreeing, and it lets a cache use the CNAME without asking an authoritative server for other types. A query for the CNAME type itself is not restarted. Other queries include the CNAME and continue at the canonical name.

RFC 1034 also says names that point at another name should point at the primary name, not at an alias. Software should follow CNAME chains and should signal a loop as an error.

How do the two records differ?

They differ in what they hand to the resolver and in where you edit them. Delegation moves authority. An alias only renames.

Question Nameserver (NS) CNAME
DNS type 2, authoritative name server 5, canonical name for an alias
Data A host name for a server A domain name, the canonical name
Job Delegate a zone or name its servers Alias one name to another name
Other data at that name NS records belong at a zone cut No other data should be present
Where you usually edit it Registrar, or NS rows for a subdomain Inside the zone that already answers
What it does not do It does not alias www to the apex It does not move the zone to a new host

RFC 1034 says NS records appear at the top of a zone, where they are authoritative, and at cuts along the bottom, where they are not. They do not belong at nodes in between. A CNAME is not that cut. It is one name standing in for another.

When should you change nameservers?

Change nameservers when a different DNS host should answer for the domain. That is the delegation step, and it is not a row you add beside an A record for a single hostname.

Cloudflare’s record reference says you add NS records in the DNS table only for a subdomain setup or when you delegate a subdomain to servers outside Cloudflare. The assigned Cloudflare nameservers themselves are managed in the nameserver section, not as ordinary rows.

As of December 2026, that page allows up to 10 NS records for one delegation name and says the practical set should stay at seven or fewer. More than 10 is not supported. The same page says each DNS record has a maximum wire format size of 4,096 bytes, citing RFC 1035.

Labels in RFC 1034 are 63 characters or less. Cloudflare repeats that limit and adds that the fully qualified name should not exceed 253 characters.

A QR code of the hostname is only a convenient way to open the name on another device. It does not tell you whether the answer came from an NS referral or from a CNAME. You still read the DNS response.

When is a CNAME the right record?

Use a CNAME when one hostname should follow another hostname, and you are not trying to delegate the zone. A common case is a name such as www that should track a canonical host.

Cloudflare says a CNAME can point at another CNAME, but the final name needs an A or AAAA record if the hostname is proxied. For proxied records, the TTL field defaults to Auto, which that page defines as 300 seconds. DNS-only records can use a custom TTL.

The same page says queries for other record types on a proxied CNAME name are not supported. A TXT record on the target does not automatically answer at the alias. CNAME flattening is Cloudflare’s own processing for some of these setups, including names at the zone apex. It is not a record type in RFC 1034.

What goes wrong if you mix them?

The usual mix-up is an alias where a delegation belongs, or a CNAME beside other data. RFC 1912 (February 1996) says NS records pointing at a CNAME are a bad configuration and can lead to a lame delegation. That memo describes BIND of its time ignoring such records. Treat that product note as 1996 practice, and treat the warning itself as the operational point.

A second failure is a chain that never reaches an address. RFC 1034 tells resolvers to follow a chain and to report a loop. Cloudflare’s proxied example makes the same demand in product terms: the last name still needs an address record.

If the site never starts answering after a host move, the nameservers at the registrar are the place to check. How the internet works is the longer path from a name to an address. The NS row is the handoff. The CNAME is only a nickname inside a zone that someone already serves.

Frequently asked questions

Can the zone apex be a CNAME?

RFC 1034 says that if a CNAME is present at a name, no other data should be present. A zone apex already has SOA and NS records, so a lone CNAME there breaks that rule. Cloudflare's record form still lists the zone apex as a possible CNAME name and describes CNAME flattening for that case. Treat flattening as a provider feature, not as standard DNS. If you need the apex to answer with addresses, use address records at the apex.

What is glue data?

RFC 1034 says parent zones need a way to reach the name servers of a child zone. NS records name those servers but do not always include addresses. If the server's name is inside the child zone, the parent also carries glue, which the RFC describes as address records for those servers. Glue is not part of the authoritative data. It is used so a referral does not ask you to learn an address from the server that has that address.

Does a CNAME copy the target's other records?

On Cloudflare, a proxied CNAME may point at another CNAME, but the final name needs a hostname with an A or AAAA record. The same page says queries for other record types on that name are not supported. Its example is a TXT record on the target that does not come back for the alias. A CNAME is not a bundle of every record at the target. Check the record type you actually query.

How long may a resolver cache a record?

RFC 1034 defines TTL as a 32-bit count of seconds. The time limit applies to cached copies, not to how the authoritative zone stores the data. A zero TTL prohibits caching. The RFC says typical host times should be on the order of days, and that you can lower the TTL before a planned change. That is guidance from the RFC, not a single required number. Cloudflare's proxied records are a separate case.

What does a DNS lookup return?

MDN's glossary says DNS is a hierarchical naming system that keeps domain names with resources such as IP addresses. A lookup maps a name to the address. A reverse lookup maps an address back to a name. The nameserver is the machine that can answer for the names it is authoritative for. A CNAME does not itself store the address. It sends the lookup on to the canonical name.

Sources