-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[DNS] Add enforce dns-only #29072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DNS] Add enforce dns-only #29072
Changes from all commits
12d9998
32439a5
0570188
7c6a15a
5578f40
e3cf5f0
2102e89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| pcx_content_type: troubleshooting | ||
| title: Enforce DNS-only | ||
| sidebar: | ||
| order: 3 | ||
| label: Enforce DNS-only | ||
| --- | ||
|
|
||
| import { APIRequest } from "~/components"; | ||
|
|
||
| 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 your origin IP addresses instead of Cloudflare anycast IP addresses, effectively setting all [proxied DNS records](/dns/proxy-status/) 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. | ||
|
|
||
| :::caution | ||
|
|
||
| Enabling this setting immediately exposes your origin IP addresses and removes all Cloudflare protections — including DDoS mitigation, WAF, caching, and all other proxy-based features — for every zone in your account. Use with extreme caution and only after proper preparation. | ||
|
|
||
| ::: | ||
|
|
||
| ## Key characteristics | ||
|
|
||
| - Account-level: Affects all zones in the account simultaneously. | ||
| - Non-destructive: Does not modify your DNS records. Disabling the setting restores normal proxy behavior. | ||
| - API-only: Available through the API only, not in the Cloudflare dashboard. | ||
|
|
||
| ## Before you begin | ||
|
|
||
| Before relying on enforce DNS-only as part of your incident response plan, you should: | ||
|
|
||
| - Verify origin server capacity: Without Cloudflare proxying, your origin servers handle all traffic directly, including traffic that Cloudflare would normally cache or filter. Ensure your infrastructure can sustain this load. | ||
| - Review exposed IP addresses: When enforce DNS-only is active, all origin IPs configured in proxied records become publicly visible through DNS queries. If your origins rely on IP obscurity for security, plan accordingly. | ||
| - Test in advance: Use the API in a staging or test account to confirm that you understand the behavior before you need it in an emergency. | ||
|
|
||
| ## Enable enforce DNS-only | ||
|
|
||
| Use the [Update DNS Settings](/api/resources/dns/subresources/settings/subresources/account/methods/edit/) endpoint to enable enforce DNS-only for your account: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which API permissions / member roles are required for this? I hope it's only SuperAdmins :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a new field on the existing endpoint, the permissions remain the same as those required for modifying other DNS settings, specifically, read/write access to DNS Record resources. |
||
|
|
||
| <APIRequest | ||
| path="/accounts/{account_id}/dns_settings" | ||
| method="PATCH" | ||
| json={{ | ||
| enforce_dns_only: true, | ||
| }} | ||
| /> | ||
|
|
||
| Once enabled, Cloudflare responds to DNS queries for all proxied records with your configured origin IP addresses instead of Cloudflare anycast IPs. | ||
|
|
||
| ## Disable enforce DNS-only | ||
|
|
||
| To restore normal proxy behavior, set `enforce_dns_only` to `false`: | ||
|
|
||
| <APIRequest | ||
| path="/accounts/{account_id}/dns_settings" | ||
| method="PATCH" | ||
| 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. | ||
|
|
||
| :::note | ||
| Due to DNS caching by recursive resolvers, the transition back to proxied behavior may not be instantaneous. The TTL of your proxied records (default 300 seconds) determines how long resolvers may continue to serve the origin IP addresses after you disable the setting. | ||
| ::: | ||
|
|
||
| ## Exceptions | ||
|
|
||
| The enforce DNS-only setting does not affect the following record types: | ||
|
|
||
| - [Spectrum](/spectrum/) applications: Already DNS-only CNAME records pointing to Spectrum endpoints. | ||
| - [Cloudflare for SaaS](/cloudflare-for-platforms/cloudflare-for-saas/) fallback origin records: The default origin where [custom hostnames](/cloudflare-for-platforms/cloudflare-for-saas/domain-support/) are routed. | ||
| - Cloudflare for SaaS records on customer zones: CNAME records on your zone that point to a SaaS provider. Setting these to DNS-only does not help if the SaaS provider's zone remains proxied. | ||
| - [Workers](/workers/) custom domains: Proxied A records pointing to `100::`. | ||
| - [R2](/r2/) custom domains: Proxied CNAME records pointing to `public.r2.dev`. | ||
| - [Web3 gateways](/web3/): Ethereum and IPFS DNSLink gateways (CNAMEs to `ethereum.cloudflare.com` or `ipfs.cloudflare.com`). | ||
| - [Cloudflare Tunnel](/cloudflare-one/connections/connect-networks/) records: Records required for tunnel routing. Setting these to DNS-only may break tunnel connectivity. | ||
|
|
||
| The setting does apply to proxied [Load Balancer](/load-balancing/) records. | ||
|
|
||
| ## Check current status | ||
|
|
||
| Use the [Show DNS Settings](/api/resources/dns/subresources/settings/subresources/account/methods/get/) endpoint to verify the current value: | ||
|
|
||
| <APIRequest path="/accounts/{account_id}/dns_settings" method="GET" /> | ||
|
|
||
| ## Related resources | ||
|
|
||
| - [Proxy status](/dns/proxy-status/) - Understand how proxied and DNS-only records behave. | ||
| - [Batch record changes](/dns/manage-dns-records/how-to/batch-record-changes/#edit-proxy-status-in-bulk) - Change proxy status for individual records in bulk within a single zone. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceptions
Records Not Affected by the Proxy Kill Switch:
100::public.r2.devethereum.cloudflare.com/ipfs.cloudflare.com)Included: