Skip to content
Start here

DNS Firewall

List DNS Firewall Clusters
dns_firewall.list(DNSFirewallListParams**kwargs) -> SyncV4PagePaginationArray[DNSFirewallListResponse]
GET/accounts/{account_id}/dns_firewall
DNS Firewall Cluster Details
dns_firewall.get(strdns_firewall_id, DNSFirewallGetParams**kwargs) -> DNSFirewallGetResponse
GET/accounts/{account_id}/dns_firewall/{dns_firewall_id}
Create DNS Firewall Cluster
dns_firewall.create(DNSFirewallCreateParams**kwargs) -> DNSFirewallCreateResponse
POST/accounts/{account_id}/dns_firewall
Update DNS Firewall Cluster
dns_firewall.edit(strdns_firewall_id, DNSFirewallEditParams**kwargs) -> DNSFirewallEditResponse
PATCH/accounts/{account_id}/dns_firewall/{dns_firewall_id}
Delete DNS Firewall Cluster
dns_firewall.delete(strdns_firewall_id, DNSFirewallDeleteParams**kwargs) -> DNSFirewallDeleteResponse
DELETE/accounts/{account_id}/dns_firewall/{dns_firewall_id}
ModelsExpand Collapse
class AttackMitigation:

Attack mitigation settings

enabled: Optional[bool]

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

only_when_upstream_unhealthy: Optional[bool]

Only mitigate attacks when upstream servers seem unhealthy

str

Cloudflare-assigned DNS IPv4 address

str

Upstream DNS Server IPv4 address

class DNSFirewallListResponse:
id: str

Identifier.

maxLength32
deprecate_any_requests: bool

Whether to refuse to answer queries for the ANY type

dns_firewall_ips: List[FirewallIPs]
ecs_fallback: bool

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

maximum_cache_ttl: float

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: float

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: datetime

Last modification of DNS Firewall cluster

formatdate-time
name: str

DNS Firewall cluster name

maxLength160
minLength1
negative_cache_ttl: Optional[float]

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: Optional[float]

Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster)

maximum1000000000
minimum100
retries: float

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

maximum2
minimum0
upstream_ips: List[UpstreamIPs]
minLength1
attack_mitigation: Optional[AttackMitigation]

Attack mitigation settings

class DNSFirewallGetResponse:
id: str

Identifier.

maxLength32
deprecate_any_requests: bool

Whether to refuse to answer queries for the ANY type

dns_firewall_ips: List[FirewallIPs]
ecs_fallback: bool

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

maximum_cache_ttl: float

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: float

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: datetime

Last modification of DNS Firewall cluster

formatdate-time
name: str

DNS Firewall cluster name

maxLength160
minLength1
negative_cache_ttl: Optional[float]

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: Optional[float]

Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster)

maximum1000000000
minimum100
retries: float

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

maximum2
minimum0
upstream_ips: List[UpstreamIPs]
minLength1
attack_mitigation: Optional[AttackMitigation]

Attack mitigation settings

class DNSFirewallCreateResponse:
id: str

Identifier.

maxLength32
deprecate_any_requests: bool

Whether to refuse to answer queries for the ANY type

dns_firewall_ips: List[FirewallIPs]
ecs_fallback: bool

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

maximum_cache_ttl: float

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: float

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: datetime

Last modification of DNS Firewall cluster

formatdate-time
name: str

DNS Firewall cluster name

maxLength160
minLength1
negative_cache_ttl: Optional[float]

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: Optional[float]

Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster)

maximum1000000000
minimum100
retries: float

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

maximum2
minimum0
upstream_ips: List[UpstreamIPs]
minLength1
attack_mitigation: Optional[AttackMitigation]

Attack mitigation settings

class DNSFirewallEditResponse:
id: str

Identifier.

maxLength32
deprecate_any_requests: bool

Whether to refuse to answer queries for the ANY type

dns_firewall_ips: List[FirewallIPs]
ecs_fallback: bool

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

maximum_cache_ttl: float

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: float

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: datetime

Last modification of DNS Firewall cluster

formatdate-time
name: str

DNS Firewall cluster name

maxLength160
minLength1
negative_cache_ttl: Optional[float]

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: Optional[float]

Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster)

maximum1000000000
minimum100
retries: float

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

maximum2
minimum0
upstream_ips: List[UpstreamIPs]
minLength1
attack_mitigation: Optional[AttackMitigation]

Attack mitigation settings

class DNSFirewallDeleteResponse:
id: Optional[str]

Identifier.

maxLength32

DNS FirewallAnalytics

DNS FirewallAnalyticsReports

Table
dns_firewall.analytics.reports.get(strdns_firewall_id, ReportGetParams**kwargs) -> Report
GET/accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report

DNS FirewallAnalyticsReportsBytimes

By Time
dns_firewall.analytics.reports.bytimes.get(strdns_firewall_id, BytimeGetParams**kwargs) -> ByTime
GET/accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report/bytime

DNS FirewallReverse DNS

Show DNS Firewall Cluster Reverse DNS
dns_firewall.reverse_dns.get(strdns_firewall_id, ReverseDNSGetParams**kwargs) -> ReverseDNSGetResponse
GET/accounts/{account_id}/dns_firewall/{dns_firewall_id}/reverse_dns
Update DNS Firewall Cluster Reverse DNS
dns_firewall.reverse_dns.edit(strdns_firewall_id, ReverseDNSEditParams**kwargs) -> ReverseDNSEditResponse
PATCH/accounts/{account_id}/dns_firewall/{dns_firewall_id}/reverse_dns
ModelsExpand Collapse
class ReverseDNSGetResponse:
ptr: Dict[str, str]

Map of cluster IP addresses to PTR record contents

class ReverseDNSEditResponse:
ptr: Dict[str, str]

Map of cluster IP addresses to PTR record contents