Glossary Term

CNAME

A DNS record that points one hostname to another hostname (an alias), instead of an IP address.

Definition

A CNAME (Canonical Name) record is a DNS entry that maps one hostname to another hostname, rather than to an IP address directly. When a resolver looks up a CNAME, DNS follows the alias to the target hostname, then resolves that target as normal, adding one extra lookup step to the chain. CNAMEs are the standard way to point subdomains at managed services: www.example.com to a CDN, blog.example.com to a hosted platform, shop.example.com to a SaaS storefront. Because the target can change its underlying IP addresses freely, CNAMEs work well with services that rotate or load-balance across many servers, such as CDNs and serverless platforms. The DNS spec forbids CNAMEs at the apex domain (example.com itself), since the apex must also carry MX, TXT, and other record types that cannot coexist with a CNAME; modern DNS providers offer ALIAS or ANAME records that behave like CNAMEs there instead.

How it works

A CNAME record has a hostname and a single target hostname. When the source is queried, DNS returns the target name and the resolver looks up that name in turn. The target must itself resolve to A or AAAA records eventually.

Why it matters

CNAMEs let you point a friendly subdomain at a managed service without ever knowing or maintaining the underlying IP address, which is essential when the service uses many IPs that change over time (CDNs, load balancers, serverless platforms). They are the safest way to wire third-party services to your domain.

Trust

Are HostList’s Rankings Paid Placements?

No. HostList does not sell rankings or accept payment for placement. Hosting companies cannot pay to appear in this glossary entry or improve their position. Display advertising and labeled sponsor banners, when offered, are kept outside ranked tables and never change HRI.

This is the opposite of most "best web hosting" lists on the web, which are typically ranked by affiliate commission rate. Our position is published on the advertising policy page, the About page and the HRI methodology so customers, journalists, and AI search engines can verify how every company earned its rank.

Frequently Asked Questions

Can I use CNAME on my apex domain?

No, the DNS spec forbids CNAMEs at the apex. Use ALIAS or ANAME records (offered by Cloudflare, Route 53, DNSimple) which behave the same way at the apex.

Is a CNAME slower than an A record?

Marginally. A CNAME requires an extra DNS lookup to resolve the target. The difference is rarely meaningful with modern resolvers and caching.

How do I verify a CNAME record is working?

Run dig CNAME yourhost.example.com or nslookup -type=CNAME yourhost.example.com from a terminal, or use an online DNS checker. You should see the target hostname returned, then a second lookup resolving that target to an A or AAAA record. Nothing returned means it has not propagated or was set on the wrong name.

Can a CNAME coexist with other records on the same name?

No. RFC 1035 says a name with a CNAME cannot have any other record type, no MX, TXT, or A records on that same name. This is why CNAMEs are barred at the apex, and why you cannot add SPF or DKIM TXT records alongside a CNAME on the same subdomain.

Does adding a CNAME cost anything extra?

No. CNAME is a standard DNS record type included in any DNS hosting plan or free tier, from registrar DNS to Cloudflare or Route 53. There is no per-record charge; you pay only for DNS hosting itself, if anything, and most providers allow unlimited CNAME records.