What is a CNAME record?
Short answer
A CNAME (Canonical Name) record is an alias record that points a name to another name (RFC 1034); e.g. the shop.example.com name can point to the shops.provider.net. name. When the resolver sees the CNAME, it resolves the target name separately and returns its address. No other record type is written for a name that carries a CNAME (RFC 2181); for this reason, CNAME is not used at the zone apex (example.com), where the SOA and NS records are located. In TR7 GTM, CNAME is selected from the Record Type list and the target name is entered in the Record cell as a full name (FQDN) ending with a dot; if the dot is missing, the "Must end with dot(.)" warning is given (record type specific fields).
Where It Is Used in TR7
| Where | Field / label | What for |
|---|---|---|
| GTM → GTM Services → service name → Records → Add | Record Type = CNAME | Creating an alias record |
| Same form | Record cell; Must end with dot(.) warning | Requiring the target name to be written as a full name ending with a dot |
| Load Balancer → Profiles → Health Checks (DNS) | DNS Record Type = CNAME | Checking the DNS server with a CNAME query |
- The trailing dot indicates that the name is full (FQDN); if the dot is not written, the name is considered completed with the name of the zone it is in, and an unintended target results. For this reason, TR7 does not accept a target without a dot.
Common Misconceptions
- "CNAME is an HTTP redirect." CNAME redirects only the name resolution; the browser's address bar does not change, and there is no redirect at the HTTP level. The redirect that changes the address bar is done with an HTTP action on the vService (How do I redirect a specific URL to another URL with a 301/302?).
- "The zone apex can also be a CNAME." Since the SOA and NS records are at the apex, CNAME is not used; an A or AAAA record is written for the apex name.
- "A CNAME target can be an IP address." CNAME always points to another name; an IP address is given with an A or AAAA record.
How it is done in the documentation
