Skip to content

Knowledgebase

Understanding Cloudflare CNAME flattening at the zone apex

performance, domains-dns

CNAME flattening lets Cloudflare resolve a CNAME target and return its final address, including at the zone apex. This allows a root domain to use a service that supplies a hostname instead of a fixed IP.

Information to have ready

Obtain the exact target from the destination service and confirm that it accepts your custom domain. Save current apex A/AAAA records and any related verification requirements.

01 Check CNAME flattening and public DNS answers

  1. Open DNS > Records and review the intended apex record.
  2. Configure the supported apex CNAME with the supplied hostname, resolving conflicting address records deliberately. Select proxy status according to the destination’s requirements.
  3. Check the public address response. At the apex, a flattened answer can return A or AAAA values rather than expose the CNAME you entered.
  4. Verify the destination application recognises your domain and has appropriate certificate coverage. DNS alone does not register a custom domain with that application.
  5. Review optional flattening settings before applying them to additional records, especially third-party verification CNAMEs.

Confirm the expected result

The root domain should reach the intended service and return valid DNS answers. Confirm both the application response and TLS, not only a successful address lookup.

Troubleshoot unexpected results

A verification provider may expect to see a literal CNAME and fail if an optional setting flattens that record. Keep verification hostnames DNS only and preserve their required record behaviour. Do not hardcode a transient address merely because a flattened lookup returned it once.

Is flattening the same as a browser redirect?

No. It changes DNS resolution. The visitor’s requested hostname remains the original domain unless an HTTP redirect separately changes the URL.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support