How to Look Up and Manage CNAME Records
CNAME (Canonical Name) records create aliases that point one hostname to another. They are widely used for subdomains, CDN integration, SaaS verification, and service delegation. A misconfigured CNAME can break your website, email, or third-party integrations. This guide covers how to look up CNAME records, when to use them, and how to avoid common pitfalls.
Look up CNAME records instantly
Use our free CNAME Lookup tool to check the CNAME chain for any hostname and see where it ultimately resolves.
Step 1: Query CNAME Records
Use dig to look up CNAME records for a hostname:
dig www.example.com CNAME +shortIf the hostname has a CNAME, the query returns the target hostname. For example, www.example.com might return example.com.cdn.cloudflare.net. If the query returns nothing, there is no CNAME for that hostname and it likely uses an A or AAAA record directly.
Step 2: Follow the CNAME Chain
A CNAME can point to another CNAME, forming a chain. To see the full resolution path:
dig www.example.com +traceLong CNAME chains increase DNS lookup time. Best practice is to keep chains to one or two hops at most. Circular chains (A points to B, B points back to A) will cause resolution failures.
Step 3: Understand CNAME Restrictions
CNAME records have strict rules in the DNS specification. A CNAME cannot coexist with any other record type at the same hostname. This means you cannot have both a CNAME and an MX record, or a CNAME and a TXT record, on the same name. This is why CNAME records are not allowed at the zone apex (root domain), which must have SOA and NS records. If you need an alias at the root, ask your DNS provider about ALIAS or ANAME record support.
Step 4: Common CNAME Use Cases
The most common uses for CNAME records include:
- www subdomain — Pointing
www.example.comtoexample.comor a CDN. - CDN integration — Pointing a subdomain to your CDN provider's endpoint.
- SaaS verification — Services like Google Workspace and Microsoft 365 ask you to create CNAME records for domain ownership verification.
- DKIM signing — DKIM selectors often use CNAME records to delegate signing to a third-party email service. Check with the DKIM Checker.
Step 5: Troubleshoot CNAME Issues
If your CNAME is not resolving, check these common problems: the target hostname does not exist, there is a conflicting record at the same name, DNS propagation has not completed, or the chain has a loop. Use the CNAME Lookup tool to inspect the chain, and the DNS Compare tool to check for record conflicts across providers.
Frequently Asked Questions
Can I use a CNAME record at the root domain (zone apex)?
No. The DNS specification prohibits CNAME records at the zone apex because a CNAME cannot coexist with other record types, and the apex always has SOA and NS records. Some providers offer workarounds like ALIAS or ANAME records that flatten the CNAME at query time.
What is the difference between a CNAME and an A record?
An A record maps a hostname directly to an IP address. A CNAME record maps a hostname to another hostname, creating an alias. The resolver follows the CNAME chain until it reaches an A record with the final IP address. CNAMEs add a small lookup overhead but are easier to maintain when the target IP changes.
Why is my CNAME record not working?
Common causes include: the CNAME target does not exist or has no A record, there is a conflicting record at the same hostname, the record has not propagated yet, or there is a CNAME chain loop. Check each of these with a DNS lookup tool.