Mondoze Knowledge Base

Search our articles or browse by category below

Understand and configure CNAME Flattening

Last modified: October 5, 2022
You are here:
Estimated reading time: 1 min

Understand and Configure CNAME Flattening

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. configure CNAME Flattening 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 follow 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.

CNAME Flattening still works if the corresponding DNS CNAME record is “grey cloud” in the DNS app of the Cloudflare dashboard.


How to change settings for CNAME Flattening

CNAME Flattening cannot be disable. By default, domains are setup to only flatten CNAME records at the root domain.

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.

Free plans can only flatten CNAMEs at the root domain.

Was this article helpful?
Dislike 0
Views: 1695