Permissions
- Account - DNS Views - Edit
- Zone - DNS - Edit
- Account - Account Settings - Edit
- Zone - DNS Settings - Edit
- Zone - Zone - Edit
Account Resources
- Include - (Your account)
Zone Resources
- Include - All zones
Follow this guide to get started with Internal DNS.
Although there are some steps that can be achieved on the dashboard, currently the whole process can only be completed via API.
API token configuration
Permissions
Account Resources
Zone Resources
type
to internal
.Internal zone configuration conditions
xyz.local
), if it is created on the TLD itself (local
), or even if on the root (.
)./batch
, to manage DNS records. Refer to Batch record changes for details.--data
, specify the internal_dns
object with the parameter reference_zone_id
. For details, refer to reference zones.
In the following example, internal zone A (ID 8a904aeb565c42cfa207d98f6edea2f3
) is referencing internal zone B (ID 8e64c6fb4b514f3faf64de81efc11e51
).
curl --request PATCH \https://api.cloudflare.com/client/v4/zones/8a904aeb565c42cfa207d98f6edea2f3/dns_settings \--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \--header "Content-Type: application/json" \--data '{ "internal_dns": { "reference_zone_id": "8e64c6fb4b514f3faf64de81efc11e51" } }'
Since the resolver policy will require a DNS view, you must have at least one view to be able to route requests to internal zones.
DNS view configuration conditions
DNS zones that contain public DNS records and are accessible by public resolvers. ↩
Besides selecting an internal DNS view when setting up your resolver policies, you can also enable the fallback through public DNS option.
Use the API endpoints under Zero Trust > Gateway > Rules to set up resolver policies. For guidance about selectors, operators, and values, refer to Gateway.
Use the rule settings object to define resolve_dns_internally
, specifying view_id
and fallback
option. The fallback options behave as follows:
none
: Gateway DNS resolver returns the response as-is to the client.public_dns
: In case the response from the internal zone is REFUSED, NXDOMAIN, or a response with a CNAME type, Gateway DNS resolver sends the query to Cloudflare 1.1.1.1 public resolver and tries to resolve the query via public DNS.