CNAME flattening

Last updated Jun 24, 2026 CNAME flattening speeds up CNAME resolution and allows you to use a CNAME record at your zone apex (example.com).

Note

This functionality is also what allows you to use a root custom domain with a Cloudflare Pages site.

How it works

With CNAME flattening, Cloudflare finds the IP address that a CNAME points to. This process could involve a single lookup or multiple (if your CNAME points to another CNAME). Cloudflare then returns the final IP address instead of a CNAME record, helping DNS queries resolve faster.

For more details on the steps involved in CNAME flattening, review the CNAME flattening diagram and refer to the Cloudflare blog post ↗︎.

Note

For information about CNAME flattening in Internal DNS, refer to internal DNS records.

Aspects to keep in mind

  • CNAME flattening happens by default in some cases. Refer to Setup for details.
  • CNAME to a different Cloudflare account is prohibited and will result in Error 1014: CNAME Cross-User Banned
  • If a CNAME target is being used to verify a domain for a third-party service, turning on CNAME flattening for all CNAME records may cause the verification to fail since the CNAME record itself will not be returned directly.
  • If the final CNAME target has no A/AAAA records (a dangling CNAME), CNAME flattening returns an empty response (NODATA) because there is no IP address to flatten to. This can make it appear as if the DNS record is not propagating. Ensure your CNAME targets resolve to valid A/AAAA records.

Was this helpful?

YesNo

On this page

CNAME flattening - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/dns/cname-flattening/#page","headline":"CNAME flattening","description":"Resolve CNAME records at the zone apex to comply with DNS standards.","url":"https://developers.cloudflare.com/dns/cname-flattening/","inLanguage":"en","image":"https://developers.cloudflare.com/dns/cname-flattening/og.png?v=0de9780c7c36d224","dateModified":"2026-06-24","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Consider an example use case and the main steps involved in CNAME flattening. title: Example diagram image: https://developers.cloudflare.com/dns/cname-flattening/cname-flattening-diagram/og.png?v=20be76b93a5dd548


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/dns/llms.txt
Use this file to discover all available pages before exploring further.