What is a CNAME record?
A CNAME record aliases one hostname to another canonical name, so the target's A and AAAA records are used to resolve the address. It is common for subdomains that point at CDNs or SaaS providers, letting you follow their infrastructure without tracking their IP addresses. When the provider changes IPs, your CNAME keeps working automatically.
How a CNAME alias resolves to an address
A CNAME does not store an IP; it points one hostname at another. When a resolver hits a CNAME, it restarts the lookup on the target name and follows its A or AAAA records to the final address. For example, shop.example.com CNAME mystore.shopify.com means a request for shop.example.com resolves through Shopify's hostname. This indirection is why CDNs and SaaS platforms hand you a CNAME target: they can change the underlying IPs freely and your subdomain follows along with no edits on your side.
How to read your CNAME results
A CNAME result shows the alias hostname and the canonical target it points to, such as www.example.com CNAME example.com or blog.example.com CNAME hosted.ghost.io. To see the final IP, follow the chain: the target's own A and AAAA records resolve the address. If a CNAME points at a target that itself has a CNAME, resolvers follow the chain, though long chains add lookups and latency. A CNAME pointing at a hostname with no records is broken and will fail to resolve.
Common CNAME mistakes and restrictions
The most important rule is that you cannot put a CNAME on the root domain (example.com), because the apex must coexist with required NS and SOA records and a CNAME may not share a name with other records. Use an A record or a provider's ALIAS/ANAME feature at the apex instead. You also cannot add a CNAME to a hostname that already has an A, MX, or TXT record. A frequent failure is pointing a CNAME at a SaaS target before activating the service there, which leaves it unresolvable.