CNAME Record

Canonical Name

Type code
5
Status
In use
Defined in
RFC 1035

What the CNAME record is for

A CNAME says that the owner name is an alias and gives the canonical name it points to. A resolver that finds a CNAME restarts the lookup at the target, for whatever type was asked.

Because the alias stands in for the whole name, a CNAME cannot sit next to any other record at the same name (DNSSEC records are the exception). That is why a CNAME is not allowed at a zone apex, which always has SOA and NS records.

CNAMEs are commonly used to point a hostname at a CDN or hosted service whose addresses the provider manages.

Wire format and fields

FieldSizeMeaning
CNAMEdomain nameThe canonical name that the owner name is an alias for.

Zone file syntax

<owner> <ttl> IN CNAME <cname>

Example

The CNAME record at www.github.com, fetched from live DNS on 27 November 2026:

www.github.com. 3600 IN CNAME github.com.

Common mistakes

  • Putting a CNAME at the zone apex (example.com). It conflicts with the SOA and NS records there; use A/AAAA, an HTTPS record, or a provider's apex-alias feature instead.
  • Adding other records, such as TXT or MX, at a name that has a CNAME. Resolvers follow the CNAME and never see them.
  • Pointing an MX, NS or SRV record at a name that is a CNAME, which the specifications forbid.
  • Leaving off the trailing dot in a zone file, so the target becomes target.example.com.example.com.
  • Building long CNAME chains or loops, which add lookups and can make resolution fail.

Specifications

  • RFC 1035: Domain names - implementation and specification
  • RFC 1034: Domain names - concepts and facilities (Defines alias processing and says no other data may exist at a CNAME's name.)
  • RFC 2181: Clarifications to the DNS Specification (Restates the no-other-data rule and that NS and MX must not point to a CNAME.)
  • IANA DNS Resource Record (RR) TYPEs registry: type code and status

Related record types

Domain Intelligence APIs

Get started with our easy-to-use API docs.