Skip to content

CNAME

A CNAME record is a type of DNS record that creates an alias from one domain name to another, redirecting queries to the destination’s canonical name.

Definition

What it is

A CNAME record (Canonical Name) is a type of DNS record that maps one domain name to another domain name, creating an alias [1]. Unlike an A record, which points directly to an IP, the CNAME tells the resolver “go look up this other name,” and the resolver follows the chain until it finds an A or AAAA record with the final IP [2].

Why it matters

The CNAME is useful when the hosting provider changes IPs: the domain keeps pointing to the provider’s name, and the provider manages the IP. It is also used for CDNs, cloud services, and subdomain aliases. However, a CNAME cannot coexist with other records at the same name.

How it works in practice

The CNAME is defined in the DNS zone. For example, www.example.com. IN CNAME example.com.. When a resolver queries www.example.com, it receives the canonical name example.com and then queries the A record of example.com to obtain the IP. This adds at least one additional lookup [2]. A CNAME cannot coexist with an A, MX, or TXT record at the same name.

Connections

  • dns — the system containing the record
  • a-record — the final record the chain usually points to
  • nameserver — the server that stores the CNAME
  • subdomain — the typical scope of CNAME use
  • dangling-cname — the risk of a CNAME pointing to a nonexistent destination

Common mistakes

  • CNAME at the apex. The apex (example.com) should not have a CNAME because it must have NS and SOA records.
  • Long chains. Each CNAME adds a lookup; excessive chains slow resolution.
  • Orphan CNAMEs. A CNAME pointing to a deleted destination can be hijacked (subdomain takeover).

Evidence

Etymology

Origin: acronym

Canonical Name — canonical name

  • C (root): Canonical
  • NAME (root): Name
Cognates

Morphology

Variants

Typographical errors

  • CName
  • cname

Plurals

  • CNAMEs

Semantic network

CNAMEdns-recordDNSA RecordNameserverSubdomainDangling C

● broader ● narrower ● related

Sources