Enforce DNS-only

Last updated Sep 11, 2026 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.

Caution

Enabling this setting 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.

Auto TTL for proxied records

Due to DNS caching by recursive resolvers, the transitions from proxied to DNS-only and back may not be instantaneous. Since all proxied records have a TTL of Auto, this value (five minutes by default) determines how long resolvers may continue to serve Cloudflare's anycast IPs or your origin IP addresses.

Zone types

Enforce DNS-only works across all zone setup types:

  • Full setup: Proxied records in the zone are generally affected, considering a few exceptions.
  • Partial (CNAME) setup: Proxied records in the zone are generally affected, considering a few exceptions.
  • Secondary zones: If Secondary DNS Overrides is enabled and you have manually set a record's proxy status to proxied, that record will be affected. This also applies to any other A or AAAA records on the same name. Refer to Secondary DNS Overrides for details.

Zone transfers interaction

While enforce DNS-only is active, zone transfers from the primary (including content or TTL changes) do not change the proxy status of affected records. When you disable enforce DNS-only, the records return to proxied.

Preparation

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 record content: When enforce DNS-only is active, all origin IPs configured in proxied A and AAAA records, as well as the targets of proxied CNAME 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.

Verify SSL certificates

If your origins serve HTTPS traffic, ensure they have publicly trusted SSL certificates installed for the relevant hostnames. Cloudflare Origin CA certificates are only trusted by Cloudflare and will cause certificate errors for direct client connections.

Enable enforce DNS-only

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

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:

  • <code>Account DNS Settings Write</code>

</details>

Update DNS Settingsbash

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:

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:

  • <code>Account DNS Settings Write</code>

</details>

Update DNS Settingsbash

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:

Proxied records that match a Worker route are regular DNS records and will be affected by the enforce DNS-only setting.

What to expect

  • Changes take effect immediately at Cloudflare's edge — there is no DNS propagation delay.
  • Functionally equivalent to setting all proxied records to DNS-only.

Check current status

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

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:

  • <code>Account DNS Settings Write</code>
  • <code>Account DNS Settings Read</code>

</details>

Show DNS Settingsbash

curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dns_settings" \
    --request GET \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
  • Proxy status - Understand how proxied and DNS-only records behave.
  • Batch record changes - Change proxy status for multiple records in bulk within a single zone.

Was this helpful?

YesNo

On this page

Enforce DNS-only - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/dns/proxy-status/enforce-dns-only/#page","headline":"Enforce DNS-only","description":"Bypass Cloudflare's reverse proxy for all zones at once.","url":"https://developers.cloudflare.com/dns/proxy-status/enforce-dns-only/","inLanguage":"en","image":"https://developers.cloudflare.com/dns/proxy-status/enforce-dns-only/og.png?v=d5aa5a98e2e852cb","dateModified":"2026-09-11","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Limitations when proxying DNS records through Cloudflare. title: Proxying limitations image: https://developers.cloudflare.com/dns/proxy-status/limitations/og.png?v=3a85ff2b41106be3


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/dns/llms.txt
Use this file to discover all available pages before exploring further.