CNAME Flattening allows a CNAME record to be created for the root domain without violating DNS specifications.
How CNAME Flattening works
Per DNS specifications (RFCs), a domain cannot have a CNAME record and another DNS record of a different type if both records would share the same name. DNS RFCs also require an MX record to correspond to a related A record and not a CNAME. This is problematic when you need a CNAME for your root (for example, a CNAME from example.com to example.herokuapp.com) but also need another type of DNS record at the root domain such as an MX record for mail delivery.
Typically, the aforementioned situation would cause problems receiving email. However, CNAME Flattening ensures the chain of CNAMEs is followed to an A or AAAA record to allow mail delivery while still adhering to DNS RFCs. The CNAME responses are cached and DNS TTLs are respected.
How to change settings for CNAME Flattening
Domains on Pro, Business and Enterprise plans can either apply CNAME Flattening to CNAMEs at the root domain or for all CNAMEs within the domain. To flatten all CNAMEs in the domain, select Flatten all CNAMEs from the CNAME Flattening dropdown menu within the DNS app of the Cloudflare dashboard.