diff --git a/src/content/docs/dns/cname-flattening/index.mdx b/src/content/docs/dns/cname-flattening/index.mdx index 08348b23435c50..6dcc0175ee47c3 100644 --- a/src/content/docs/dns/cname-flattening/index.mdx +++ b/src/content/docs/dns/cname-flattening/index.mdx @@ -22,9 +22,9 @@ This functionality is also what allows you to use a [root custom domain](/pages/ 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 up to 30% faster. -For more details on the mechanics of `CNAME` flattening, review the [CNAME flattening diagram](/dns/cname-flattening/cname-flattening-diagram/) and refer to the [Cloudflare blog post](https://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/). +For more details on the steps involved in `CNAME` flattening, review the [CNAME flattening diagram](/dns/cname-flattening/cname-flattening-diagram/) and refer to the [Cloudflare blog post](https://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/). ## Aspects to keep in mind -* `CNAME` flattening happens by default in some cases, as explained in its [Setup page](/dns/cname-flattening/set-up-cname-flattening/) +* `CNAME` flattening happens by default in some cases. Refer to [Setup](/dns/cname-flattening/set-up-cname-flattening/) for details. * diff --git a/src/content/docs/dns/cname-flattening/set-up-cname-flattening.mdx b/src/content/docs/dns/cname-flattening/set-up-cname-flattening.mdx index bca0b465f48ae1..dd5118943d1fe7 100644 --- a/src/content/docs/dns/cname-flattening/set-up-cname-flattening.mdx +++ b/src/content/docs/dns/cname-flattening/set-up-cname-flattening.mdx @@ -9,7 +9,7 @@ head: --- -import { Render } from "~/components" +import { Render, TabItem, Tabs, GlossaryTooltip } from "~/components" :::note @@ -25,11 +25,19 @@ If the `CNAME` target is on the same zone as the `CNAME` record, Cloudflare proc ## For all CNAME records -Accounts on paid plans can choose to flatten all `CNAME` records on their domain. This option is useful for DNS-only (unproxied) `CNAME` records since proxied records are flattened by default (as they return Cloudflare IPv4 and IPv6 addresses). +For zones on paid plans, you can choose to flatten all `CNAME` records. This option is useful for DNS-only (unproxied) `CNAME` records. [Proxied records](/dns/manage-dns-records/reference/proxied-dns-records/#proxied-records) are flattened by default as they return Cloudflare anycast IPs. + + 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account and domain. 2. Go to **DNS** > **Settings**. -3. For **CNAME Flattening**, select **Flatten all CNAMEs**. +3. Turn on the option **CNAME flattening for all CNAME records**. + + + +Make a `PATCH` request to the [Update DNS Settings](/api/operations/dns-settings-for-a-zone-update-dns-settings) endpoint and set `flatten_all_cnames` to `true` in the request body. + + :::caution @@ -37,7 +45,24 @@ Accounts on paid plans can choose to flatten all `CNAME` records on their domain ## Per record -Accounts on paid plans also have the option to flatten specific `CNAME` records. This operation is currently only supported via API. +Paid zones also have the option of flattening specific `CNAME` records. + + + +1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account and domain. +2. In **DNS** > **Settings**, make sure that **CNAME flattening for all CNAME records** is turned off. +3. Go to **DNS** > **Records** and find the `CNAME` record you would like to flatten. +4. Select **Edit** and turn on the **Flatten** option. +5. Select **Save** to confirm. + +:::note[Unavailable flatten option] +For the following cases, **Flatten** will not be available: +- The record is at the [zone apex](#for-your-zone-apex). +- The record is already proxied, which means it will be flattened by default. +- **CNAME flattening for all CNAME records** is turned on, which means you cannot override it per record. +::: + + With the available [API endpoints](/api/operations/dns-records-for-a-zone-create-dns-record), specify the following for each `CNAME` record in the request body: @@ -45,4 +70,6 @@ With the available [API endpoints](/api/operations/dns-records-for-a-zone-create "settings": { "flatten_cname": true } -``` \ No newline at end of file +``` + + diff --git a/src/content/partials/dns/cname-flattening-callout.mdx b/src/content/partials/dns/cname-flattening-callout.mdx index d527ee76f92cf9..f94820dde836d5 100644 --- a/src/content/partials/dns/cname-flattening-callout.mdx +++ b/src/content/partials/dns/cname-flattening-callout.mdx @@ -3,4 +3,4 @@ --- -If a `CNAME` target is being used to verify a domain for a third-party service, enabling the [Flatten all CNAMEs](/dns/cname-flattening/set-up-cname-flattening/#for-all-cname-records) setting may cause that functionality to work incorrectly since the `CNAME` record itself will not be returned directly. +If a `CNAME` target is being used to verify a domain for a third-party service, turning on [CNAME flattening for all CNAME records](/dns/cname-flattening/set-up-cname-flattening/#for-all-cname-records) may cause the verification to fail since the `CNAME` record itself will not be returned directly.