---
title: DNS Firewall
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# DNS Firewall

##### [List DNS Firewall Clusters](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/methods/list)

client.dnsFirewall.list(DNSFirewallListParams { account\_id, page, per\_page } params, RequestOptionsoptions?): V4PagePaginationArray<[DNSFirewallListResponse](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20dns%5Ffirewall%5Flist%5Fresponse%20%3E%20%28schema%29) { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } \>

GET/accounts/{account\_id}/dns\_firewall

##### [DNS Firewall Cluster Details](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/methods/get)

client.dnsFirewall.get(stringdnsFirewallID, DNSFirewallGetParams { account\_id } params, RequestOptionsoptions?): [DNSFirewallGetResponse](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20dns%5Ffirewall%5Fget%5Fresponse%20%3E%20%28schema%29) { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } 

GET/accounts/{account\_id}/dns\_firewall/{dns\_firewall\_id}

##### [Create DNS Firewall Cluster](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/methods/create)

client.dnsFirewall.create(DNSFirewallCreateParams { account\_id, name, upstream\_ips, 9 more } params, RequestOptionsoptions?): [DNSFirewallCreateResponse](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20dns%5Ffirewall%5Fcreate%5Fresponse%20%3E%20%28schema%29) { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } 

POST/accounts/{account\_id}/dns\_firewall

##### [Update DNS Firewall Cluster](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/methods/edit)

client.dnsFirewall.edit(stringdnsFirewallID, DNSFirewallEditParams { account\_id, attack\_mitigation, deprecate\_any\_requests, 8 more } params, RequestOptionsoptions?): [DNSFirewallEditResponse](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20dns%5Ffirewall%5Fedit%5Fresponse%20%3E%20%28schema%29) { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } 

PATCH/accounts/{account\_id}/dns\_firewall/{dns\_firewall\_id}

##### [Delete DNS Firewall Cluster](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/methods/delete)

client.dnsFirewall.delete(stringdnsFirewallID, DNSFirewallDeleteParams { account\_id } params, RequestOptionsoptions?): [DNSFirewallDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20dns%5Ffirewall%5Fdelete%5Fresponse%20%3E%20%28schema%29) { id } 

DELETE/accounts/{account\_id}/dns\_firewall/{dns\_firewall\_id}

##### ModelsExpand Collapse 

AttackMitigation { enabled, only\_when\_upstream\_unhealthy } 

Attack mitigation settings

enabled?: boolean

When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers

only\_when\_upstream\_unhealthy?: boolean

Only mitigate attacks when upstream servers seem unhealthy

FirewallIPs \= string

Cloudflare-assigned DNS IPv4 address

UpstreamIPs \= string

Upstream DNS Server IPv4 address

DNSFirewallListResponse { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } 

id: string

Identifier.

maxLength32

deprecate\_any\_requests: boolean

Whether to refuse to answer queries for the ANY type

dns\_firewall\_ips: Array<[FirewallIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20firewall%5Fips%20%3E%20%28schema%29)\>

ecs\_fallback: boolean

Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent

maximum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets an upper bound on this duration. For caching purposes, higher TTLs will be decreased to the maximum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

minimum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets a lower bound on this duration. For caching purposes, lower TTLs will be increased to the minimum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

Note that, even with this setting, there is no guarantee that a response will be cached for at least the specified duration. Cached responses may be removed earlier for capacity or other operational reasons.

maximum36000

minimum30

modified\_on: string

Last modification of DNS Firewall cluster

formatdate-time

name: string

DNS Firewall cluster name

maxLength160

minLength1

negative\_cache\_ttl: number | null

This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

ratelimit: number | null

Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.

maximum1000000000

minimum100

retries: number

Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)

maximum2

minimum0

upstream\_ips: Array<[UpstreamIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20upstream%5Fips%20%3E%20%28schema%29)\>

minLength1

attack\_mitigation?: [AttackMitigation](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20attack%5Fmitigation%20%3E%20%28schema%29) { enabled, only\_when\_upstream\_unhealthy } | null

Attack mitigation settings

DNSFirewallGetResponse { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } 

id: string

Identifier.

maxLength32

deprecate\_any\_requests: boolean

Whether to refuse to answer queries for the ANY type

dns\_firewall\_ips: Array<[FirewallIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20firewall%5Fips%20%3E%20%28schema%29)\>

ecs\_fallback: boolean

Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent

maximum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets an upper bound on this duration. For caching purposes, higher TTLs will be decreased to the maximum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

minimum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets a lower bound on this duration. For caching purposes, lower TTLs will be increased to the minimum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

Note that, even with this setting, there is no guarantee that a response will be cached for at least the specified duration. Cached responses may be removed earlier for capacity or other operational reasons.

maximum36000

minimum30

modified\_on: string

Last modification of DNS Firewall cluster

formatdate-time

name: string

DNS Firewall cluster name

maxLength160

minLength1

negative\_cache\_ttl: number | null

This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

ratelimit: number | null

Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.

maximum1000000000

minimum100

retries: number

Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)

maximum2

minimum0

upstream\_ips: Array<[UpstreamIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20upstream%5Fips%20%3E%20%28schema%29)\>

minLength1

attack\_mitigation?: [AttackMitigation](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20attack%5Fmitigation%20%3E%20%28schema%29) { enabled, only\_when\_upstream\_unhealthy } | null

Attack mitigation settings

DNSFirewallCreateResponse { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } 

id: string

Identifier.

maxLength32

deprecate\_any\_requests: boolean

Whether to refuse to answer queries for the ANY type

dns\_firewall\_ips: Array<[FirewallIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20firewall%5Fips%20%3E%20%28schema%29)\>

ecs\_fallback: boolean

Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent

maximum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets an upper bound on this duration. For caching purposes, higher TTLs will be decreased to the maximum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

minimum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets a lower bound on this duration. For caching purposes, lower TTLs will be increased to the minimum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

Note that, even with this setting, there is no guarantee that a response will be cached for at least the specified duration. Cached responses may be removed earlier for capacity or other operational reasons.

maximum36000

minimum30

modified\_on: string

Last modification of DNS Firewall cluster

formatdate-time

name: string

DNS Firewall cluster name

maxLength160

minLength1

negative\_cache\_ttl: number | null

This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

ratelimit: number | null

Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.

maximum1000000000

minimum100

retries: number

Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)

maximum2

minimum0

upstream\_ips: Array<[UpstreamIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20upstream%5Fips%20%3E%20%28schema%29)\>

minLength1

attack\_mitigation?: [AttackMitigation](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20attack%5Fmitigation%20%3E%20%28schema%29) { enabled, only\_when\_upstream\_unhealthy } | null

Attack mitigation settings

DNSFirewallEditResponse { id, deprecate\_any\_requests, dns\_firewall\_ips, 10 more } 

id: string

Identifier.

maxLength32

deprecate\_any\_requests: boolean

Whether to refuse to answer queries for the ANY type

dns\_firewall\_ips: Array<[FirewallIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20firewall%5Fips%20%3E%20%28schema%29)\>

ecs\_fallback: boolean

Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent

maximum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets an upper bound on this duration. For caching purposes, higher TTLs will be decreased to the maximum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

minimum\_cache\_ttl: number

By default, Cloudflare attempts to cache responses for as long as indicated by the TTL received from upstream nameservers. This setting sets a lower bound on this duration. For caching purposes, lower TTLs will be increased to the minimum value defined by this setting.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

Note that, even with this setting, there is no guarantee that a response will be cached for at least the specified duration. Cached responses may be removed earlier for capacity or other operational reasons.

maximum36000

minimum30

modified\_on: string

Last modification of DNS Firewall cluster

formatdate-time

name: string

DNS Firewall cluster name

maxLength160

minLength1

negative\_cache\_ttl: number | null

This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers.

This setting does not affect the TTL value in the DNS response Cloudflare returns to clients. Cloudflare will always forward the TTL value received from upstream nameservers.

maximum36000

minimum30

ratelimit: number | null

Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.

maximum1000000000

minimum100

retries: number

Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)

maximum2

minimum0

upstream\_ips: Array<[UpstreamIPs](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20upstream%5Fips%20%3E%20%28schema%29)\>

minLength1

attack\_mitigation?: [AttackMitigation](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall%20%3E%20%28model%29%20attack%5Fmitigation%20%3E%20%28schema%29) { enabled, only\_when\_upstream\_unhealthy } | null

Attack mitigation settings

DNSFirewallDeleteResponse { id } 

id?: string

Identifier.

maxLength32

#### DNS FirewallAnalytics

#### DNS FirewallAnalyticsReports

##### [Table](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/subresources/analytics/subresources/reports/methods/get)

Deprecated

client.dnsFirewall.analytics.reports.get(stringdnsFirewallID, ReportGetParams { account\_id, dimensions, filters, 5 more } params, RequestOptionsoptions?): [Report](https://developers.cloudflare.com/api/typescript/resources/dns#%28resource%29%20dns.analytics.reports%20%3E%20%28model%29%20report%20%3E%20%28schema%29) { data, data\_lag, max, 4 more } 

GET/accounts/{account\_id}/dns\_firewall/{dns\_firewall\_id}/dns\_analytics/report

#### DNS FirewallAnalyticsReportsBytimes

##### [By Time](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/subresources/analytics/subresources/reports/subresources/bytimes/methods/get)

Deprecated

client.dnsFirewall.analytics.reports.bytimes.get(stringdnsFirewallID, BytimeGetParams { account\_id, dimensions, filters, 6 more } params, RequestOptionsoptions?): [ByTime](https://developers.cloudflare.com/api/typescript/resources/dns#%28resource%29%20dns.analytics.reports.bytimes%20%3E%20%28model%29%20by%5Ftime%20%3E%20%28schema%29) { data, data\_lag, max, 5 more } 

GET/accounts/{account\_id}/dns\_firewall/{dns\_firewall\_id}/dns\_analytics/report/bytime

#### DNS FirewallReverse DNS

##### [Show DNS Firewall Cluster Reverse DNS](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/subresources/reverse%5Fdns/methods/get)

client.dnsFirewall.reverseDNS.get(stringdnsFirewallID, ReverseDNSGetParams { account\_id } params, RequestOptionsoptions?): [ReverseDNSGetResponse](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall.reverse%5Fdns%20%3E%20%28model%29%20reverse%5Fdns%5Fget%5Fresponse%20%3E%20%28schema%29) { ptr } 

GET/accounts/{account\_id}/dns\_firewall/{dns\_firewall\_id}/reverse\_dns

##### [Update DNS Firewall Cluster Reverse DNS](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall/subresources/reverse%5Fdns/methods/edit)

client.dnsFirewall.reverseDNS.edit(stringdnsFirewallID, ReverseDNSEditParams { account\_id, ptr } params, RequestOptionsoptions?): [ReverseDNSEditResponse](https://developers.cloudflare.com/api/typescript/resources/dns%5Ffirewall#%28resource%29%20dns%5Ffirewall.reverse%5Fdns%20%3E%20%28model%29%20reverse%5Fdns%5Fedit%5Fresponse%20%3E%20%28schema%29) { ptr } 

PATCH/accounts/{account\_id}/dns\_firewall/{dns\_firewall\_id}/reverse\_dns

##### ModelsExpand Collapse 

ReverseDNSGetResponse { ptr } 

ptr: Record<string, string\>

Map of cluster IP addresses to PTR record contents

ReverseDNSEditResponse { ptr } 

ptr: Record<string, string\>

Map of cluster IP addresses to PTR record contents