How do I point my root domain to a DO app through CNAME without losing my MX records?

Posted February 19, 2021 746 views
DNSDigitalOcean App Platform

I have recently tried to set up a DigitalOcean App Platform. It was indeed a pleasure to find the ease with which I can launch a basic site without setting up anything myself, but I am having problems with pointing my domain to the url generated for my app. I have added a CNAME pointing to it, but I cannot do that for the “@” class, ie. for the root domain without losing my MX records which point to Google. Please advise

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

CNAMEs aren’t valid at the root (sometimes call apex) of a domain. To use App Platform at the root of a domain you need to use a technique called CNAME Flattening (sometimes also called an “ANAME” or alias record). The easiest way to achieve this is let DigitalOcean manage your domain. App Platform will automatically configure CNAME flattening for any DigitalOcean managed domains you add to your app. CNAME flattening is supported by a number of other provides including Cloudflare, namecheap, and DNSimple.