A CNAME record (canonical name record) is a DNS record that turns one domain name into an alias for another. If www.example.com has a CNAME pointing to example.com, anyone who looks up the www name is sent on to example.com and gets that name's IP address.
How does a CNAME record work?
When a browser needs the address for a hostname, it asks a DNS resolver. If the resolver finds a CNAME instead of an address record, it restarts the lookup at the target name. RFC 1034, the original DNS standard, describes exactly this: the server includes the CNAME in its answer and restarts the query at the canonical name.
The browser then connects to the IP address it found. It still tells the web server which name it asked for, in the HTTP Host header. That is how one server can host many sites, and why the address bar never changes. A CNAME is not a redirect.
What are the rules for CNAME records?
- No other records on the same name. RFC 1034 says that if a CNAME is present at a name, no other data should be present. RFC 2181 confirms it (DNSSEC records are the only exception).
- Not on the root domain. The root of a domain (
example.com) must carry SOA and NS records, so a standard CNAME can't go there. Some DNS providers offer non-standard ALIAS or ANAME records for this case. - Avoid chains. A CNAME that points to another CNAME is legal but slower to resolve, and RFC 2181 says the target should not itself be an alias.
- Don't point MX or NS records at an alias. Mail and name server records should name a host with its own address records.
Where do marketers run into CNAME records?
Sales and marketing teams usually meet CNAMEs when they connect a tool to their own domain:
- Domain verification. Google Workspace asks for a unique CNAME to prove you own a domain or to reset an admin password.
- Custom web addresses. Google's help notes that CNAMEs can change or customize a web address. A team can point
go.example.comat a hosted landing page or event site so visitors see the company's own subdomain. - Email authentication. Microsoft 365 stores the public keys for DKIM signing behind two CNAME records per custom domain. Other email systems use TXT records instead.
An example
A B2B software company runs its webinar pages on a separate hosting platform. The marketing team adds a CNAME so that events.example.com points to the hostname the platform gives them. Visitors type or click events.example.com, DNS follows the alias to the platform's servers, and the page loads under the company's name. The main website and its MX records are untouched, because the CNAME only lives on the events name.
Related terms
Frequently asked questions
Is a CNAME record the same as a redirect?
No. A CNAME works at the DNS level and only tells the visitor's device where to find the server. The address in the browser stays the same. A redirect is an HTTP response that sends the browser to a different URL, which the visitor then sees.
Can I put a CNAME record on my root domain?
Not under the DNS standards. A name with a CNAME may not hold other ordinary records, and the root of a domain (example.com) must hold SOA and NS records. Some DNS providers offer non-standard ALIAS or ANAME records to get the same effect at the root.
How long does a new CNAME record take to work?
It depends on your DNS host and the record's time to live (TTL). Google's Workspace help says CNAME changes can take up to 72 hours but usually take effect much sooner.