CNAME flattening was popularized in part by Cloudflare, and I have used CNAME flattening successfully for an extended period of time with multiple web-hosting providers.
For the layperson, DNS A records are a pre-WWW artifact necessary to resolve the apex domain
You may see some old 2014 blog posts initially complaining about the idea of CNAME flattening, citing some initial hiccups.
For my websites, I did not experience these long-resolved hiccups.
To enable CNAME flattening with your DNS records, first screenshot or otherwise backup your DNS settings. Don’t do this experiment during busy times, better to use on a little-used or test website first to ensure it works correctly with your complete setup.
- Determine the web address your web hosting provider puts your website at. E.g. for Gitlab Pages it would be
- Remove DNS
example.comthat points to a specific IP address
- Add a
example.comto the server address from step #1
Let’s say my Gitlab username was
joe and I have a Gitlab Pages site at
joe.gitlab.io, and I’d like to have the web address
So I make a
CNAME DNS record with
example.com as an alias to
CNAME Flattening reference
See the Cloudflare CNAME flattening article and blog post for more details.