CNAME Records
A CNAME record makes one name an alias of another. A lookup for the alias returns the target’s
records. Use it to point a subdomain at a hostname with an existing address, such as a load balancer
or a platform-as-a-service endpoint.
Fields
Section titled “Fields”| Field | Example | Notes |
|---|---|---|
| Name | blog | Relative to the zone. |
| Type | CNAME | |
| Content | www.example.com. | The target hostname. End it with a trailing dot. |
| TTL | 14400 | Seconds. Default 4 hours. |
Create
Section titled “Create”Console (zone-file view):
blog CNAME www.example.com. 14400CLI:
zcp dns record-create --domain examplecom --name blog --type CNAME --content www.example.com.API: POST with { "name": "blog", "type": "CNAME", "content": "www.example.com.", "ttl": 14400 }.
Verify
Section titled “Verify”dig blog.example.com +short# www.example.com.# 203.0.113.10The answer shows the alias, then the target’s address.
- Not at the apex. A
CNAMEcannot sit at the zone root (@). The apex already hasSOAandNSrecords, and aCNAMEcannot coexist with other records at the same name. Use anAorAAAArecord for the apex. - Alone at its name. A name with a
CNAMEcannot also hold anA,MX,TXT, or any other record. Pick one. - Trailing dot. End the target with a dot (
www.example.com.) so ZCP treats it as an absolute name and does not append your zone.
See also: A and AAAA, Worked examples, Record types