From 97617357da40cc221160b8d63ef5a88eebdf2a63 Mon Sep 17 00:00:00 2001 From: Rebecca Tamachiro Date: Thu, 7 Nov 2024 19:07:39 +0000 Subject: [PATCH 1/5] Add Dash and API tabs for Per-record CNAME flattening --- .../set-up-cname-flattening.mdx | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) 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..c668852faaae0c 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 } from "~/components" :::note @@ -37,7 +37,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. +Accounts on paid plans also have the option to flatten 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 +62,6 @@ With the available [API endpoints](/api/operations/dns-records-for-a-zone-create "settings": { "flatten_cname": true } -``` \ No newline at end of file +``` + + From 9fdcb13f5bd1cad51aa332a512ac0deb7f43cd29 Mon Sep 17 00:00:00 2001 From: Rebecca Tamachiro Date: Fri, 8 Nov 2024 10:23:43 +0000 Subject: [PATCH 2/5] Overall text review --- src/content/docs/dns/cname-flattening/index.mdx | 2 +- .../docs/dns/cname-flattening/set-up-cname-flattening.mdx | 6 +++--- src/content/partials/dns/cname-flattening-callout.mdx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/dns/cname-flattening/index.mdx b/src/content/docs/dns/cname-flattening/index.mdx index 08348b23435c50..16707c2a2e6edd 100644 --- a/src/content/docs/dns/cname-flattening/index.mdx +++ b/src/content/docs/dns/cname-flattening/index.mdx @@ -22,7 +22,7 @@ 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 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 c668852faaae0c..03f168094738ef 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, TabItem, Tabs } from "~/components" +import { Render, TabItem, Tabs, GlossaryTooltip } from "~/components" :::note @@ -25,11 +25,11 @@ 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). +Accounts on paid plans can choose to flatten all `CNAME` records on their domain. 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**. :::caution 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. From a926da0c3ed577bf587cbe7982dd7f09474a4536 Mon Sep 17 00:00:00 2001 From: Rebecca Tamachiro Date: Fri, 8 Nov 2024 10:39:16 +0000 Subject: [PATCH 3/5] Fix paid accounts to paid zones --- .../docs/dns/cname-flattening/set-up-cname-flattening.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 03f168094738ef..bcff9534b9279e 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 @@ -25,7 +25,7 @@ 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. [Proxied records](/dns/manage-dns-records/reference/proxied-dns-records/#proxied-records) are flattened by default as they return Cloudflare anycast IPs. +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**. @@ -37,7 +37,7 @@ 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. +Paid zones also have the option of flattening specific `CNAME` records. From 09e620b09760abe7e9107012eb1a17b42d61df6c Mon Sep 17 00:00:00 2001 From: Rebecca Tamachiro Date: Fri, 8 Nov 2024 16:15:57 +0000 Subject: [PATCH 4/5] Add API tab to Flatten all CNAMEs section --- src/content/docs/dns/cname-flattening/index.mdx | 2 +- .../dns/cname-flattening/set-up-cname-flattening.mdx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/content/docs/dns/cname-flattening/index.mdx b/src/content/docs/dns/cname-flattening/index.mdx index 16707c2a2e6edd..6dcc0175ee47c3 100644 --- a/src/content/docs/dns/cname-flattening/index.mdx +++ b/src/content/docs/dns/cname-flattening/index.mdx @@ -26,5 +26,5 @@ For more details on the steps involved in `CNAME` flattening, review the [CNAME ## 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 bcff9534b9279e..b4495150823261 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 @@ -27,10 +27,18 @@ If the `CNAME` target is on the same zone as the `CNAME` record, Cloudflare proc 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. 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 ::: @@ -51,7 +59,7 @@ Paid zones also have the option of flattening specific `CNAME` records. 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. +- **CNAME flattening for all CNAME records** is turned on, which means you cannot override it per record. ::: From 6f6540b3902dcc1be4d2accf8aeda25e1ea6aa78 Mon Sep 17 00:00:00 2001 From: Rebecca Tamachiro <62246989+RebeccaTamachiro@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:59:24 +0000 Subject: [PATCH 5/5] Apply suggestion from code review Co-authored-by: Pedro Sousa <680496+pedrosousa@users.noreply.github.com> --- .../docs/dns/cname-flattening/set-up-cname-flattening.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b4495150823261..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 @@ -51,7 +51,7 @@ 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. +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.