Back to articles
The Complete Guide to CNAME Records: Zone Apex Limitations, ANAME Records, and Common Pitfalls

The Complete Guide to CNAME Records: Zone Apex Limitations, ANAME Records, and Common Pitfalls

via Dev.to WebdevJakkie Koekemoer

You're setting up your new blog on Heroku. Their docs tell you to add a CNAME pointing to your-app.herokuapp.com . You open your DNS panel, create www.yourdomain.com as a CNAME, and it works perfectly. Then you try to do the same thing for the root domain, yourdomain.com , and hit an error: "CNAME records cannot be created for the root domain." This isn't a Heroku problem. It's not a bug in your DNS provider either. It's a rule baked into the DNS specification itself: a CNAME record can't coexist with other record types at the zone apex. Because the root of your domain must carry records like SOA and NS, a standard CNAME simply isn't allowed there. Modern DNS providers work around this with features called ALIAS, ANAME , or CNAME flattening. Platforms like Heroku also document how to configure root domain pointing using these mechanisms. That said, the underlying rule still matters. To understand why this restriction exists, and when it causes real production problems, you need to unde

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
7 views

Related Articles