Glossary

CNAME record

A CNAME (canonical name) record makes one DNS name an alias of another: a resolver that asks for the alias is told the canonical name and continues its lookup there.

Also called: Canonical name record, DNS alias

How a CNAME is followed

Suppose app.customer.com has a CNAME to customers.yourproduct.com. A browser's resolver asks for the address of app.customer.com, and the customer's nameservers answer that the name is an alias for customers.yourproduct.com. The resolver then asks for that name's addresses, which your own DNS controls, and hands both answers back together. Each step is cached for its own TTL.

Nothing about HTTP changes. The browser still sends Host: app.customer.com, and it still expects a TLS certificate for app.customer.com. A CNAME moves traffic to your servers; it does not tell them which customer the traffic belongs to, and it does not issue a certificate. Both are your application's job.

The rules a CNAME must follow

  • Nothing else may share its name. RFC 1034 section 3.6.2 says so and RFC 2181 section 10.1 restates it as absolute. A name with a CNAME cannot also have a TXT, MX or A record. DNSSEC signature records are the one exception.
  • It cannot sit at a zone apex, because the apex always carries SOA and NS records. See apex domain.
  • The target must be a hostname, never an IP address. To point a name at an address, use an A record.
  • MX and NS records must not point at a CNAME (RFC 2181 section 10.3). Many providers accept the input anyway; some mail servers then fail in ways that are hard to trace.
  • Chains work but cost lookups. An alias of an alias is legal, and each hop is another query and another cache entry that can be stale.

Why custom domains are built on CNAMEs

A CNAME hands control of the addresses to you. If the customer's record says "app.customer.com is customers.yourproduct.com", you can move to a new load balancer, add regions or change providers without asking a single customer to edit DNS again. An A record would pin your current IPs into every customer's zone.

The cost is the apex restriction and the "nothing else at this name" rule. If your verification flow also needs a TXT record, it must live at a different name, which is why ownership proofs sit at names like _dodomain-challenge.app.customer.com rather than at app.customer.com itself.

When a CNAME reads back as an A record

Look up a name you know has a CNAME and sometimes the authoritative nameservers answer with addresses instead. That is a proxy or flattening feature at the DNS host: with Cloudflare's proxy enabled, for example, a proxied name answers with Cloudflare's edge addresses, and a flattened CNAME answers with the target's current addresses. The record is saved correctly; the answer is rewritten. The DNS propagation checker shows what the authoritative nameservers actually return, which is the value verification will see.

Related

Frequently asked questions

What does CNAME stand for?

Canonical name. The record says that the name it sits at is an alias, and the value is the canonical name the resolver should look up instead.

Can a CNAME point to an IP address?

No. A CNAME's target must be a hostname. To point a name at an IPv4 address use an A record, and for IPv6 an AAAA record.

Can a CNAME and a TXT record exist at the same name?

No. A name that has a CNAME may not carry any other record type apart from DNSSEC signatures. Put the TXT record at a different name, such as an underscore-prefixed label below it.

Should a SaaS custom domain use a CNAME or an A record?

A CNAME wherever the customer can use a subdomain, because it lets you change your own addresses without asking customers to edit DNS. A records are the fallback for apex domains, and they turn your IP addresses into a promise to every connected customer.

Why does my CNAME show up as an A record when I look it up?

Your DNS host is rewriting the answer, usually because a proxy is enabled on the record or the host flattens CNAMEs. The record is stored as a CNAME, but queries receive the addresses it resolves to.