CNAME Record Alias
The CNAME record (Canonical Name record) creates an alias from one domain name to another. Instead of pointing to an IP address like an A record, a CNAME points to another domain name, which then resolves to the final IP address.
Look Up CNAME Records
Check CNAME records for any domain using our free DNS lookup tool.
Look Up CNAME Records →What Is a CNAME Record?
A CNAME record creates an alias that points one domain name to another "canonical" (true) domain name. When a DNS resolver encounters a CNAME, it follows the chain to find the actual IP address.
Think of it like mail forwarding — mail sent to one address gets redirected to another.
Similarly, a request to www.example.com can be redirected to example.com.
CNAME Record Format
A CNAME record consists of these components:
| Component | Description | Example |
|---|---|---|
| Name | The alias domain | www.example.com |
| Type | Record type identifier | CNAME |
| TTL | Time to live (cache duration in seconds) | 3600 |
| Value | The canonical (target) domain name | example.com |
Example CNAME Record
www.example.com. 3600 IN CNAME example.com.
This record makes www.example.com an alias for example.com. Any request to www.example.com will be resolved using example.com's A record.
How CNAME Resolution Works
When a DNS resolver looks up a domain with a CNAME record:
- Query: "What is the IP for www.example.com?"
- Response: "www.example.com is a CNAME for example.com"
- Query: "What is the IP for example.com?"
- Response: "example.com has A record 93.184.216.34"
- Final result: www.example.com → 93.184.216.34
This means CNAME resolution requires at least one additional DNS lookup, which can add slight latency.
Common CNAME Use Cases
1. WWW Subdomain
Point www to the root domain:
www.example.com. 3600 IN CNAME example.com.
2. Third-Party Services
Point subdomains to external service providers:
blog.example.com. 3600 IN CNAME example.ghost.io.
shop.example.com. 3600 IN CNAME shops.myshopify.com.
mail.example.com. 3600 IN CNAME ghs.google.com.
docs.example.com. 3600 IN CNAME hosting.gitbook.io.
3. CDN Integration
Point your domain to a CDN:
cdn.example.com. 3600 IN CNAME d111111abcdef8.cloudfront.net.
static.example.com. 3600 IN CNAME example.b-cdn.net.
4. Domain Verification
Verify domain ownership for services:
_domainkey.example.com. 3600 IN CNAME example.domainkey.u1234567.wl001.sendgrid.net.
CNAME Restrictions
Important Restrictions
CNAME records have specific limitations that must be followed:
1. Cannot Coexist with Other Records
A CNAME record cannot exist at the same name as any other record type. This is invalid:
; INVALID - CNAME cannot coexist with MX
example.com. IN CNAME other.com.
example.com. IN MX 10 mail.example.com.
2. Cannot Be Used at Zone Apex
You cannot create a CNAME for your root domain (zone apex) because root domains need SOA and NS records, which would conflict with the CNAME.
; INVALID - Cannot use CNAME at root
example.com. IN CNAME other.com.
To redirect your root domain, use an A record, or some DNS providers offer "ALIAS" or "ANAME" pseudo-records that work around this limitation.
3. Avoid CNAME Chains
While technically valid, chains of CNAMEs pointing to other CNAMEs add latency and complexity:
; Avoid chains like this
www.example.com. CNAME site.example.com.
site.example.com. CNAME hosting.provider.com.
CNAME vs A Record
| Feature | CNAME Record | A Record |
|---|---|---|
| Points to | Another domain name | IP address directly |
| Can be used at root | No | Yes |
| Can coexist with other records | No | Yes |
| Resolution speed | Requires additional lookups | Direct resolution |
| Target IP changes | Automatically updated | Requires manual update |
| Best for | Subdomains, external services | Root domains, direct hosting |
CNAME vs ALIAS/ANAME
Some DNS providers offer ALIAS or ANAME records that work like CNAMEs but can be used at the zone apex:
- ALIAS/ANAME — Resolves at the DNS server level, returning an A record to clients
- CNAME — Standard DNS record, returns the alias to clients for them to resolve
If you need CNAME-like functionality for your root domain, check if your DNS provider supports ALIAS records.
CNAME Best Practices
- Use for subdomains, not root — CNAMEs work great for subdomains but cannot be used at the zone apex.
- Keep chains short — Avoid CNAME → CNAME chains when possible. Point directly to the final hostname.
- Consider TTL propagation — The effective TTL is the minimum of all TTLs in the resolution chain.
- Don't use for MX targets — MX records should point to hostnames with A/AAAA records, not CNAMEs.
- Document external dependencies — When using CNAMEs to third-party services, document the dependency.
Troubleshooting CNAME Records
Common issues and solutions:
- CNAME not working at root domain — CNAMEs cannot be used at the zone apex. Use an A record or ALIAS instead.
- CNAME conflicts with other records — Remove any other records at the same name before creating a CNAME.
- Resolution loops — Ensure CNAMEs don't create circular references (A → B → A).
- SSL certificate errors — The target hostname's SSL certificate must cover your alias domain, or you need your own certificate.
Monitor DNS Records at Scale
DNS Explorer — Track CNAME records and all DNS records across your entire domain portfolio. Detect when third-party service endpoints change.
Start free DNS Explorer trial14-day full-feature trial
Check Your CNAME Records
Use our DNS Record Finder to look up CNAME records for any domain.
Look Up CNAME Records →