Skip to content

Commit 759e3b1

Browse files
[DNS] Review set-up-cname-flattening and add per-record Dash option (#18053)
* Add Dash and API tabs for Per-record CNAME flattening * Overall text review * Fix paid accounts to paid zones * Add API tab to Flatten all CNAMEs section * Apply suggestion from code review Co-authored-by: Pedro Sousa <[email protected]> --------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent 52ce350 commit 759e3b1

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

src/content/docs/dns/cname-flattening/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ This functionality is also what allows you to use a [root custom domain](/pages/
2222

2323
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.
2424

25-
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/).
25+
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/).
2626

2727
## Aspects to keep in mind
2828

29-
* `CNAME` flattening happens by default in some cases, as explained in its [Setup page](/dns/cname-flattening/set-up-cname-flattening/)
29+
* `CNAME` flattening happens by default in some cases. Refer to [Setup](/dns/cname-flattening/set-up-cname-flattening/) for details.
3030
* <Render file="cname-flattening-callout" />

src/content/docs/dns/cname-flattening/set-up-cname-flattening.mdx

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ head:
99

1010
---
1111

12-
import { Render } from "~/components"
12+
import { Render, TabItem, Tabs, GlossaryTooltip } from "~/components"
1313

1414
:::note
1515

@@ -25,24 +25,51 @@ If the `CNAME` target is on the same zone as the `CNAME` record, Cloudflare proc
2525

2626
## For all CNAME records
2727

28-
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).
28+
For zones on paid plans, you can choose to flatten all `CNAME` records. This option is useful for <GlossaryTooltip term="proxy status">DNS-only (unproxied)</GlossaryTooltip> `CNAME` records. [Proxied records](/dns/manage-dns-records/reference/proxied-dns-records/#proxied-records) are flattened by default as they return Cloudflare anycast IPs.
29+
30+
<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">
2931

3032
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account and domain.
3133
2. Go to **DNS** > **Settings**.
32-
3. For **CNAME Flattening**, select **Flatten all CNAMEs**.
34+
3. Turn on the option **CNAME flattening for all CNAME records**.
35+
36+
</TabItem> <TabItem label="API">
37+
38+
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.
39+
40+
</TabItem> </Tabs>
3341

3442
:::caution
3543
<Render file="cname-flattening-callout" />
3644
:::
3745

3846
## Per record
3947

40-
Accounts on paid plans also have the option to flatten specific `CNAME` records. This operation is currently only supported via API.
48+
Paid zones also have the option of flattening specific `CNAME` records.
49+
50+
<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">
51+
52+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account and domain.
53+
2. In **DNS** > **Settings**, make sure that **CNAME flattening for all CNAME records** is turned off.
54+
3. Go to **DNS** > **Records** and find the `CNAME` record you would like to flatten.
55+
4. Select **Edit** and turn on the **Flatten** option.
56+
5. Select **Save** to confirm.
57+
58+
:::note[Unavailable flatten option]
59+
For the following cases, **Flatten** will not be available:
60+
- The record is at the [zone apex](#for-your-zone-apex).
61+
- The record is already proxied, which means it will be flattened by default.
62+
- **CNAME flattening for all CNAME records** is turned on, which means you cannot override it per record.
63+
:::
64+
65+
</TabItem> <TabItem label="API">
4166

4267
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:
4368

4469
```txt
4570
"settings": {
4671
"flatten_cname": true
4772
}
48-
```
73+
```
74+
75+
</TabItem> </Tabs>

src/content/partials/dns/cname-flattening-callout.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
---
55

6-
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.
6+
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.

0 commit comments

Comments
 (0)