Skip to content

Commit cabdb71

Browse files
[iDNS] Clarify CNAME flattening and reference zones (#20891)
* Add conditional rendering for create internal zone * Clear out unused components from internal-zone-create * Fix syntax to make conditional property opitional * Add .yaml file so that iDNS comes up in /products * Update DNS records link to point to #internal-dns-records * Create and apply partial for reference-zone-intro * Add info about CNAME flatenning to iDNS docs * Add note about wildcard record and reference zones * Revert "Add .yaml file so that iDNS comes up in /products" This reverts commit 5dff074. * Create dedicated pages to reference zones and internal records * Descride CNAME flattening behavior with reference zones and view * Add CNAME flattening example * Re-org and further detail reference zones conditions * Remove redundant reference-zone-intro partial * Fix link to get-started and more specific CNAME h2 * Add quotes to labels to fix mermaid diagram * More generic CNAME flattening explanation and adjust example * Link to more context around Gateway resolver in iDNS
1 parent abc42b4 commit cabdb71

File tree

8 files changed

+86
-21
lines changed

8 files changed

+86
-21
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ With CNAME flattening, Cloudflare finds the IP address that a CNAME points to. T
2020

2121
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/).
2222

23+
:::note
24+
For information about CNAME flattening in [Internal DNS](/dns/internal-dns/), refer to [internal DNS records](/dns/internal-dns/internal-zones/internal-dns-records/).
25+
:::
26+
2327
## Aspects to keep in mind
2428

2529
* CNAME flattening happens by default in some cases. Refer to [Setup](/dns/cname-flattening/set-up-cname-flattening/) for details.

src/content/docs/dns/internal-dns/dns-views.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Details, Render } from "~/components";
1010

1111
Internal DNS views are logical groupings of [internal DNS zones](/dns/internal-dns/internal-zones/). As explained in the [architecture overview](/dns/internal-dns/#architecture-overview), DNS views are referenced by [Gateway resolver policies](/cloudflare-one/policies/gateway/resolver-policies/) to define how a specific query should be resolved.
1212

13-
Refer to the sections below for details on how to manage your DNS views, or consider the [get started](/dns/internal-dns/#architecture-overview) for a complete workflow.
13+
Refer to the sections below for details on how to manage your DNS views, or consider the [get started](/dns/internal-dns/get-started/) for a complete workflow.
1414

1515
## Configuration conditions
1616

src/content/docs/dns/internal-dns/get-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Although there are some steps that can be achieved on the dashboard, currently t
4747

4848
### (Optional) Reference a zone from another zone
4949

50-
1. Use the [Update DNS settings](/api/resources/dns/subresources/settings/methods/edit/) endpoint to add a reference from an internal zone to another internal zone. In `--data`, specify the `internal_dns` object with the parameter `reference_zone_id`. For details, refer to [reference zones](/dns/internal-dns/internal-zones/#reference-zones).
50+
1. Use the [Update DNS settings](/api/resources/dns/subresources/settings/methods/edit/) endpoint to add a reference from an internal zone to another internal zone. In `--data`, specify the `internal_dns` object with the parameter `reference_zone_id`. For details, refer to [reference zones](/dns/internal-dns/internal-zones/reference-zones/).
5151

5252
<Example>
5353
<Render file="internal-reference-zone-api"/>

src/content/docs/dns/internal-dns/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ flowchart LR
7676
end
7777
```
7878

79-
Internal DNS zones contain the <GlossaryTooltip term="DNS record" link="/dns/internal-dns/internal-zones/#internal-dns-records">DNS records</ GlossaryTooltip> that should be used to resolve an internal DNS query. Also, if no internal record is found within a matching internal zone, Cloudflare will check if the matching internal zone is [referencing another internal zone](/dns/internal-dns/internal-zones/#reference-zones).
79+
Internal DNS zones contain the <GlossaryTooltip term="DNS record" link="/dns/internal-dns/internal-zones/internal-dns-records/">DNS records</ GlossaryTooltip> that should be used to resolve an internal DNS query. Also, if no internal record is found within a matching internal zone, Cloudflare will check if the matching internal zone is [referencing another internal zone](/dns/internal-dns/internal-zones/reference-zones/).
8080

8181
<Example>
8282

src/content/docs/dns/internal-dns/internal-zones/index.mdx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,14 @@ sidebar:
77
label: Internal zones
88
---
99

10-
import { Example, Render } from "~/components";
10+
import { Example, Render, DirectoryListing } from "~/components";
1111

12-
Internal DNS zones are groupings of internal DNS records. While [public DNS records](/dns/manage-dns-records/) contain information about resources that you want to make available to the public Internet, [internal DNS records](#internal-dns-records) allow you to manage resources that should only be available within your private network.
12+
Internal DNS zones are groupings of internal DNS records. While [public DNS records](/dns/manage-dns-records/) contain information about resources that you want to make available to the public Internet, [internal DNS records](/dns/internal-dns/internal-zones/internal-dns-records/) allow you to manage resources that should only be available within your private network.
1313

1414
Refer to [Manage internal zones](/dns/internal-dns/internal-zones/setup/) for a full list of configuration conditions and step-by-step instructions.
1515

1616
Internal DNS zones do not get assigned Cloudflare nameservers and can only be queried via [Cloudflare Gateway](/cloudflare-one/policies/gateway/resolver-policies/) when linked to a [DNS view](/dns/internal-dns/dns-views/). The Gateway configuration must exist within the same Cloudflare account where the internal zone exists.
1717

18-
## Reference zones
18+
## Resources
1919

20-
<Render file="reference-zone-intro" />
21-
22-
Refer to [Set up reference zones](/dns/internal-dns/internal-zones/reference-zones/) for step-by-step instructions.
23-
24-
## Internal DNS records
25-
26-
Internal zones can contain the same [DNS record types](/dns/manage-dns-records/reference/dns-record-types/) that Cloudflare supports for public zones.
27-
28-
You can manage internal DNS records in the same way as you would manage public DNS records, with the difference that [proxy status](/dns/proxy-status/) does not apply to internal DNS records.
29-
30-
Refer to [Manage DNS records](/dns/manage-dns-records/how-to/create-dns-records/) or to the [API documentation](/api/resources/dns/subresources/records/) for further guidance.
20+
<DirectoryListing />
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
pcx_content_type: concept
3+
title: Manage internal DNS records
4+
sidebar:
5+
order: 4
6+
label: Internal DNS records
7+
---
8+
9+
import { Details, Example } from "~/components";
10+
11+
Internal zones can contain the same [DNS record types](/dns/manage-dns-records/reference/dns-record-types/) that Cloudflare supports for public zones.
12+
13+
You can manage internal DNS records in the same way as you would manage public DNS records, with the difference that [proxy status](/dns/proxy-status/) does not apply to internal DNS records.
14+
15+
Refer to [Manage DNS records](/dns/manage-dns-records/how-to/create-dns-records/) or to the [API documentation](/api/resources/dns/subresources/records/) for further guidance.
16+
17+
## CNAME flattening in Internal DNS
18+
19+
With CNAME flattening, Cloudflare finds the final target content that a CNAME points to and then returns this content instead of a CNAME record. With Internal DNS, CNAME flattening is applied by default and cannot be turned off.
20+
21+
Cloudflare will try to flatten the CNAME record considering both the specified [DNS view](/dns/internal-dns/dns-views/) and any existing [reference zones](/dns/internal-dns/internal-zones/reference-zones/). If the reference zone then has another CNAME, the record will again be considered from the perspective of the original view.
22+
23+
<Details header="Example">
24+
25+
- Query for the `A` record on `abc.example.local` with view ID 111.
26+
- Zone 600 references zone 700, which is not linked to any view.
27+
28+
```mermaid
29+
flowchart LR
30+
accTitle: Internal DNS zones and CNAME flattening example
31+
accDescr: Diagram exemplifying Internal DNS zones and containing CNAME and A records
32+
33+
subgraph Internal DNS
34+
subgraph Zone 700 - net
35+
A["@ A 192.0.2.10"]
36+
B["xyz CNAME def.example.local"]
37+
end
38+
subgraph View 111 - London
39+
subgraph Zone 600 - example.local
40+
X["@ A 192.0.2.1"]
41+
Y["abc CNAME xyz.net"]
42+
U["def TXT 15192-51"]
43+
Z["def A 192.0.2.9"]
44+
end
45+
end
46+
end
47+
```
48+
49+
After finding the CNAME record that points to `xyz.net`, Cloudflare cannot resolve it within zone 600. However, since this zone is referencing zone 700, this will be considered in the resolution.
50+
51+
The record in zone 700 points to `def.example.local`, which Cloudflare will then try to resolve in the original view. As an `A` record can be found for `def.example.local`, Cloudflare will return the corresponding IP address - in this example, `192.0.2.9`.
52+
53+
</Details>
54+
55+
If it is not possible to flatten the CNAME record, the following will happen:
56+
57+
1. The CNAME record is returned to [Gateway resolver](/dns/internal-dns/#architecture-overview) as-is.
58+
2. Gateway resolver will process the returned record, depending on the **Fallback through public DNS** configuration:
59+
- On: Gateway will try to resolve the query by sending it to Cloudflare's public DNS resolver ([1.1.1.1](/1.1.1.1/)).
60+
- Off: Gateway will return the response as-is to the client.

src/content/docs/dns/internal-dns/internal-zones/reference-zones.mdx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
---
22
pcx_content_type: how-to
3-
title: Set up reference zones
3+
title: Reference zones
44
sidebar:
55
order: 4
66
---
77

88
import { Example, Render } from "~/components";
99

10-
<Render file="reference-zone-intro" />
10+
During an [internal DNS query resolution](/dns/internal-dns/#architecture-overview), if no internal record is found within a matching internal zone, Cloudflare will check if the matching internal zone is referencing another internal zone. Successive references can be followed with a maximum of five references in a chain.
1111

12-
## Steps
12+
:::note
13+
A wildcard record (`*.example.local`) in the matching internal zone will take precedence over an exact match in a referenced zone.
14+
:::
15+
16+
## Configuration conditions
17+
18+
- Each internal zone can only reference one other zone.
19+
- The same zone can be referenced by multiple internal zones.
20+
- Public zones cannot be used as reference zones.
21+
- Reference zones do not have to be linked to the same [DNS view](/dns/internal-dns/dns-views/) as the zone referencing them. They may also not be linked to any view at all.
22+
23+
## Set up
1324

1425
To set up a reference zone, use the [Update DNS settings](/api/resources/dns/subresources/settings/methods/edit/) endpoint. In `--data`, specify the `internal_dns` object with the parameter `reference_zone_id`.
1526

src/content/docs/dns/internal-dns/internal-zones/setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
import { Example, Render } from "~/components";
99

10-
Refer to the following sections to learn how to manage your internal DNS zones.
10+
Refer to the following sections to learn how to manage your [internal DNS zones](/dns/internal-dns/internal-zones/).
1111

1212
## Configuration conditions
1313

0 commit comments

Comments
 (0)