INTEGRITY Cloudflare Docs

Enforce DNS-only

The enforce DNS-only setting is an account-level break-glass mechanism that allows you to bypass Cloudflare's reverse proxy for all zones in your account in a single action. When enabled, Cloudflare responds to DNS queries with the underlying record content — origin IP addresses for proxied A and AAAA records, and CNAME targets for proxied CNAME records — instead of Cloudflare's anycast IP addresses, effectively setting all proxied DNS records to DNS-only without modifying the records themselves.

This setting is intended for emergency situations only, such as during an outage when you need to quickly route traffic directly to your origins.

Key characteristics

Zone types

Enforce DNS-only works across all zone setup types:

Preparation

Before relying on enforce DNS-only as part of your incident response plan, you should:

Enable enforce DNS-only

Use the Update DNS Settings endpoint to enable enforce DNS-only for your account:

Required API token permissions

At least one of the following token permissions is required:
Update DNS Settings
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dns_settings" \
	--request PATCH \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"enforce_dns_only": true
	}'

Once enabled, Cloudflare responds to DNS queries for all proxied records with the underlying record content — your configured origin IP addresses for A and AAAA records, and the configured CNAME target for CNAME records — instead of Cloudflare's anycast IPs.

Disable enforce DNS-only

To restore normal proxy behavior, set enforce_dns_only to false:

Required API token permissions

At least one of the following token permissions is required:
Update DNS Settings
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dns_settings" \
	--request PATCH \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"enforce_dns_only": false
	}'

After you disable the setting, Cloudflare resumes responding to DNS queries with anycast IP addresses for proxied records and all proxy-based features are restored.

Other Cloudflare products

Refer to the sections below in case you use other Cloudflare products that rely on DNS records.

Included

Enforce DNS-only affects the following records:

Excluded

Enforce DNS-only does not affect the following records:

What to expect

Check current status

Use the Show DNS Settings endpoint to verify the current value:

Required API token permissions

At least one of the following token permissions is required:
Show DNS Settings
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dns_settings" \
	--request GET \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"