As the lead for many Cloudflare zones, would you put the account-level enforce DNS-only switch in your incident runbook, and on what terms?
answer
- one API call, every zone
- records untouched, answers changed
- what the origins must survive
- certificates browsers will trust
- some records stay proxied
basics
~20 sOnly as a tested last resort: enforce_dns_only bypasses Cloudflare's proxy for every zone at once, exposing every proxied origin and removing WAF, cache and DDoS protection, so origins need capacity, publicly trusted certificates and a rotation plan first.
solid answer
~50 sCloudflare's `enforce_dns_only` account setting, available only through the API, makes every proxied record in the account answer with its real content instead of anycast IPs, without editing the records; turning it off restores proxying. It is a break-glass for an outage on the proxy path, and it trades protection for reachability: WAF, caching and DDoS mitigation disappear for every zone, and every proxied record's origin becomes public. I would include it only if origins can take uncached traffic, serve publicly trusted certificates (an Origin CA certificate fails for direct visitors), and would still accept non-Cloudflare traffic once flipped. I would also limit who can flip it, test it in a staging account, define the trigger, and plan to rotate exposed IPs afterwards. Records it does not touch, such as Tunnel CNAMEs and Workers custom domains, stay on Cloudflare.
code
bash · 4 linescurl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dns_settings" \
--request PATCH \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{"enforce_dns_only": true}'go deeper
Know that Cloudflare has an account-wide, API-only switch that makes proxied records answer with origin addresses, and that it removes all proxy protection.
Explain that it changes answers rather than records, that resolvers lag by the Auto TTL, and which product records it includes and excludes.
Check origins before relying on it: publicly trusted certificates, capacity without the cache, and a lockdown that will not reject the direct traffic.
Decide whether an account-wide break-glass fits at all, or a per-zone fallback, and set who may flip it, on what trigger, and how exposure is cleaned up.
## What the switch does **Enforce DNS-only** is an account-level setting, `enforce_dns_only`, changed with a `PATCH` to the account's `dns_settings` endpoint. It has no dashboard control. When it is `true`, Cloudflare answers queries for **every proxied record in every zone of the account** with the underlying content: origin IPs for `A` and `AAAA`, the configured target for `CNAME`. The records themselves are not modified, so setting it back to `false` restores normal proxying. Behaviour worth knowing before an incident: - **Speed.** The change applies at Cloudflare's edge immediately, but resolvers may keep serving cached anycast answers for up to the proxied records' Auto TTL, five minutes by default, and the same lag applies on the way back. - **Scope.** Full and partial (CNAME) setups are affected; on secondary zones, only records proxied through Secondary DNS Overrides. - **Included:** Load Balancing hostnames, proxied records that match a Worker route, and the Cloudflare for SaaS fallback origin. - **Excluded:** R2 custom domains, Spectrum applications, CNAMEs pointing at a Cloudflare Tunnel, Web3 gateways and Workers custom domains keep running through Cloudflare. ## What it costs Flipping the switch turns a Cloudflare problem into an origin problem: | Lost or exposed | Consequence | |---|---| | Caching | Origins take every request that the edge used to answer | | WAF and DDoS mitigation | Attack traffic, and any attacker already watching, reaches origins directly | | Origin IP secrecy | Every proxied origin's address is published in DNS | | Edge certificates | Browsers now see the origin's own certificate | The certificate point catches teams out: **Cloudflare Origin CA certificates are trusted only by Cloudflare**, so an origin using one shows certificate errors to every direct visitor. And an origin that is correctly locked down to accept only Cloudflare's IP ranges, or only Authenticated Origin Pulls, will reject the direct traffic the switch sends it; the lockdown and the break-glass work against each other. ## The decision There is no single right answer, and three positions are defensible: 1. **No account-level break-glass.** Accept dependence on Cloudflare's proxy, keep origins locked down and private, and use Tunnel-published or Workers-hosted services that the switch would not touch anyway. Best when origins could not survive direct traffic. 2. **Per-zone fallback.** For a few critical zones, prepare the origin and edit proxy status in bulk within that zone when needed, keeping every other zone protected. 3. **Account-level switch in the runbook.** Fastest recovery when many zones depend on the proxy path and their origins can stand alone. ## Terms I would set if it goes in - **Readiness per origin:** publicly trusted certificates for the hostnames, capacity tested without the cache, and a firewall policy that can be opened deliberately. - **Access:** an API token scoped to the account's DNS settings and nothing else, held by a small on-call group, with every change logged. - **Trigger:** a named condition, such as a confirmed outage on the proxy path, not a slow page or a WAF false positive, which have narrower fixes. - **Rehearsal:** run it in a staging account first, as Cloudflare advises, and time how long resolvers take to follow. - **Exit:** a planned return to `false`, a check that every zone answers anycast again, and a rotation of the origin IPs that were published. ## A runbook outline 1. Confirm the trigger: the failure is on Cloudflare's proxy path, and narrower fixes, such as disabling one rule or one Worker route, do not help. 2. Open the origin firewalls that only allow Cloudflare's ranges, deliberately and on a timer. 3. Send `enforce_dns_only: true`, then read the setting back with a `GET`. 4. Watch origin load and error rates while resolvers follow the change for about five minutes. 5. When the proxy path recovers, send `false`, confirm anycast answers return, and close the firewalls again. 6. Schedule the rotation of every origin address that was published, and record the incident. ## What changed Before this setting was added on 2026-04-28, bypassing the proxy meant editing proxy status within each zone; the account-wide switch makes the trade much faster to make, and much easier to make by mistake.
- During an incident, why might visitors still reach Cloudflare for a few minutes after enforce DNS-only is turned on?Cloudflare's edge applies the setting at once, but recursive resolvers may still hold the earlier anycast answers until their TTL runs out. Proxied records use Auto, five minutes by default, so the switch, and the switch back, take up to about that long to reach most clients.
- Which services keep running through Cloudflare while enforce DNS-only is on?R2 custom domains, Spectrum applications, CNAMEs pointing at a Cloudflare Tunnel, Web3 gateways and Workers custom domains are excluded. Load Balancing hostnames, records matching a Worker route and a Cloudflare for SaaS fallback origin are included and switch to DNS-only answers.
- Enforce DNS-only rewrites each record's proxy status, so it must be undone record by record.
- It can be toggled per zone from the dashboard's DNS Settings page.
- Origins keep their Origin CA certificates, so direct visitors see no TLS errors.
- The switch also bypasses the proxy for Tunnel and Workers custom domain hostnames.
- Turning it off makes the exposed origin IPs secret again.
Assumes Cloudflare as of 2026-10-10; the account-level enforce_dns_only setting was added on 2026-04-28, and before it, bypassing the proxy meant editing proxy status within each zone.