Skip to content
Start here

Settings

SettingsZone

Show DNS Settings
dns.settings.zone.get(ZoneGetParams**kwargs) -> ZoneGetResponse
GET/zones/{zone_id}/dns_settings
Update DNS Settings
dns.settings.zone.edit(ZoneEditParams**kwargs) -> ZoneEditResponse
PATCH/zones/{zone_id}/dns_settings
ModelsExpand Collapse
class ZoneGetResponse: …
flatten_all_cnames: bool

Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.

Deprecatedfoundation_dns: bool

foundation_dns is deprecated. Use nameservers.type: cloudflare.advanced to turn on Advanced Nameservers and cloudflare.standard to turn it off. This field will be removed in a future API version.

Deprecated. Use nameservers.type to configure Advanced Nameservers.

internal_dns: InternalDNS

Settings for this internal zone.

reference_zone_id: Optional[str]

The ID of the zone to fallback to.

multi_provider: bool

Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.

nameservers: Nameservers

Controls the nameservers through which the zone is available.

One of the following:
class NameserversDNSSettingsZoneNameserversCloudflare: …
type: Literal["cloudflare.standard", "cloudflare.advanced"]

Nameserver type.

One of the following:
"cloudflare.standard"
"cloudflare.advanced"
class NameserversDNSSettingsZoneNameserversCustomExisting: …
type: Literal["custom.account", "custom.tenant", "custom.zone"]

Nameserver type.

One of the following:
"custom.account"
"custom.tenant"
"custom.zone"
ns_set: Optional[int]

Configured nameserver set number to use for this zone.

maximum5
minimum1
class NameserversDNSSettingsZoneNameserversCustomSet: …
nameserver_set_id: str

Identifier of the account-owned Custom Nameserver Set to use for this zone.

maxLength32
minLength32
type: Literal["custom"]

Nameserver type.

ns_ttl: float

The time to live (TTL) of the zone’s nameserver (NS) records.

maximum86400
minimum30
secondary_overrides: bool

Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.

soa: SOA

Components of the zone’s SOA record.

expire: Optional[float]

Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.

maximum2419200
minimum86400
min_ttl: Optional[float]

The time to live (TTL) for negative caching of records within the zone.

maximum86400
minimum60
mname: Optional[str]

The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.

refresh: Optional[float]

Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.

maximum86400
minimum600
retry: Optional[float]

Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.

maximum86400
minimum600
rname: Optional[str]

The email address of the zone administrator, with the first label representing the local part of the email address.

ttl: Optional[float]

The time to live (TTL) of the SOA record itself.

maximum86400
minimum300
zone_mode: Literal["standard", "cdn_only", "dns_only"]

Whether the zone mode is a regular or CDN/DNS only zone.

One of the following:
"standard"
"cdn_only"
"dns_only"
class ZoneEditResponse: …
flatten_all_cnames: bool

Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.

Deprecatedfoundation_dns: bool

foundation_dns is deprecated. Use nameservers.type: cloudflare.advanced to turn on Advanced Nameservers and cloudflare.standard to turn it off. This field will be removed in a future API version.

Deprecated. Use nameservers.type to configure Advanced Nameservers.

internal_dns: InternalDNS

Settings for this internal zone.

reference_zone_id: Optional[str]

The ID of the zone to fallback to.

multi_provider: bool

Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.

nameservers: Nameservers

Controls the nameservers through which the zone is available.

One of the following:
class NameserversDNSSettingsZoneNameserversCloudflare: …
type: Literal["cloudflare.standard", "cloudflare.advanced"]

Nameserver type.

One of the following:
"cloudflare.standard"
"cloudflare.advanced"
class NameserversDNSSettingsZoneNameserversCustomExisting: …
type: Literal["custom.account", "custom.tenant", "custom.zone"]

Nameserver type.

One of the following:
"custom.account"
"custom.tenant"
"custom.zone"
ns_set: Optional[int]

Configured nameserver set number to use for this zone.

maximum5
minimum1
class NameserversDNSSettingsZoneNameserversCustomSet: …
nameserver_set_id: str

Identifier of the account-owned Custom Nameserver Set to use for this zone.

maxLength32
minLength32
type: Literal["custom"]

Nameserver type.

ns_ttl: float

The time to live (TTL) of the zone’s nameserver (NS) records.

maximum86400
minimum30
secondary_overrides: bool

Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.

soa: SOA

Components of the zone’s SOA record.

expire: Optional[float]

Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.

maximum2419200
minimum86400
min_ttl: Optional[float]

The time to live (TTL) for negative caching of records within the zone.

maximum86400
minimum60
mname: Optional[str]

The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.

refresh: Optional[float]

Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.

maximum86400
minimum600
retry: Optional[float]

Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.

maximum86400
minimum600
rname: Optional[str]

The email address of the zone administrator, with the first label representing the local part of the email address.

ttl: Optional[float]

The time to live (TTL) of the SOA record itself.

maximum86400
minimum300
zone_mode: Literal["standard", "cdn_only", "dns_only"]

Whether the zone mode is a regular or CDN/DNS only zone.

One of the following:
"standard"
"cdn_only"
"dns_only"

SettingsAccount

Show DNS Settings
dns.settings.account.get(AccountGetParams**kwargs) -> AccountGetResponse
GET/accounts/{account_id}/dns_settings
Update DNS Settings
dns.settings.account.edit(AccountEditParams**kwargs) -> AccountEditResponse
PATCH/accounts/{account_id}/dns_settings
ModelsExpand Collapse
class AccountGetResponse: …
zone_defaults: ZoneDefaults

Default settings for new zones created in this account.

flatten_all_cnames: bool

Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.

Deprecatedfoundation_dns: bool

foundation_dns is deprecated. Use nameservers.type: cloudflare.advanced to turn on Advanced Nameservers and cloudflare.standard to turn it off. This field will be removed in a future API version.

Deprecated. Use nameservers.type to configure Advanced Nameservers.

internal_dns: ZoneDefaultsInternalDNS

Settings for this internal zone.

reference_zone_id: Optional[str]

The ID of the zone to fallback to.

multi_provider: bool

Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.

nameservers: ZoneDefaultsNameservers

Settings determining the nameservers through which the zone should be available.

type: Literal["cloudflare.standard", "cloudflare.advanced", "cloudflare.standard.random", 2 more]

Nameserver type

One of the following:
"cloudflare.standard"
"cloudflare.advanced"
"cloudflare.standard.random"
"custom.account"
"custom.tenant"
ns_ttl: float

The time to live (TTL) of the zone’s nameserver (NS) records.

maximum86400
minimum30
secondary_overrides: bool

Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.

soa: ZoneDefaultsSOA

Components of the zone’s SOA record.

expire: Optional[float]

Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.

maximum2419200
minimum86400
min_ttl: Optional[float]

The time to live (TTL) for negative caching of records within the zone.

maximum86400
minimum60
mname: Optional[str]

The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.

refresh: Optional[float]

Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.

maximum86400
minimum600
retry: Optional[float]

Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.

maximum86400
minimum600
rname: Optional[str]

The email address of the zone administrator, with the first label representing the local part of the email address.

ttl: Optional[float]

The time to live (TTL) of the SOA record itself.

maximum86400
minimum300
zone_mode: Literal["standard", "cdn_only", "dns_only"]

Whether the zone mode is a regular or CDN/DNS only zone.

One of the following:
"standard"
"cdn_only"
"dns_only"
enforce_dns_only: Optional[bool]

When enabled, forces all proxied DNS records in the account to behave as DNS-only at the edge, regardless of each record’s individual proxy setting. Note that this account-level override does not modify the records themselves; it only affects how they are served at the edge. See more on Enforce DNS-only.

class AccountEditResponse: …
zone_defaults: ZoneDefaults

Default settings for new zones created in this account.

flatten_all_cnames: bool

Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.

Deprecatedfoundation_dns: bool

foundation_dns is deprecated. Use nameservers.type: cloudflare.advanced to turn on Advanced Nameservers and cloudflare.standard to turn it off. This field will be removed in a future API version.

Deprecated. Use nameservers.type to configure Advanced Nameservers.

internal_dns: ZoneDefaultsInternalDNS

Settings for this internal zone.

reference_zone_id: Optional[str]

The ID of the zone to fallback to.

multi_provider: bool

Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.

nameservers: ZoneDefaultsNameservers

Settings determining the nameservers through which the zone should be available.

type: Literal["cloudflare.standard", "cloudflare.advanced", "cloudflare.standard.random", 2 more]

Nameserver type

One of the following:
"cloudflare.standard"
"cloudflare.advanced"
"cloudflare.standard.random"
"custom.account"
"custom.tenant"
ns_ttl: float

The time to live (TTL) of the zone’s nameserver (NS) records.

maximum86400
minimum30
secondary_overrides: bool

Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.

soa: ZoneDefaultsSOA

Components of the zone’s SOA record.

expire: Optional[float]

Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.

maximum2419200
minimum86400
min_ttl: Optional[float]

The time to live (TTL) for negative caching of records within the zone.

maximum86400
minimum60
mname: Optional[str]

The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.

refresh: Optional[float]

Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.

maximum86400
minimum600
retry: Optional[float]

Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.

maximum86400
minimum600
rname: Optional[str]

The email address of the zone administrator, with the first label representing the local part of the email address.

ttl: Optional[float]

The time to live (TTL) of the SOA record itself.

maximum86400
minimum300
zone_mode: Literal["standard", "cdn_only", "dns_only"]

Whether the zone mode is a regular or CDN/DNS only zone.

One of the following:
"standard"
"cdn_only"
"dns_only"
enforce_dns_only: Optional[bool]

When enabled, forces all proxied DNS records in the account to behave as DNS-only at the edge, regardless of each record’s individual proxy setting. Note that this account-level override does not modify the records themselves; it only affects how they are served at the edge. See more on Enforce DNS-only.

SettingsAccountNameserver Sets

List Custom Nameserver Sets
dns.settings.account.nameserver_sets.list(NameserverSetListParams**kwargs) -> SyncV4PagePaginationArray[NameserverSetListResponse]
GET/accounts/{account_id}/dns_settings/nameserver_sets
Get Custom Nameserver Set
dns.settings.account.nameserver_sets.get(strnameserver_set_id, NameserverSetGetParams**kwargs) -> NameserverSetGetResponse
GET/accounts/{account_id}/dns_settings/nameserver_sets/{nameserver_set_id}
Create Custom Nameserver Set
dns.settings.account.nameserver_sets.create(NameserverSetCreateParams**kwargs) -> NameserverSetCreateResponse
POST/accounts/{account_id}/dns_settings/nameserver_sets
Delete Custom Nameserver Set
dns.settings.account.nameserver_sets.delete(strnameserver_set_id, NameserverSetDeleteParams**kwargs) -> NameserverSetDeleteResponse
DELETE/accounts/{account_id}/dns_settings/nameserver_sets/{nameserver_set_id}
ModelsExpand Collapse
One of the following:
class DNSSettingsNameserverSetStandardResponse: …
id: str

Identifier for a nameserver set.

maxLength32
minLength32
advanced: Literal[false]

Whether the nameserver set uses Advanced anycast groups.

created_on: datetime

When the nameserver set was created.

formatdate-time
ip_set: int

Selects the account-specific IP set that supplies the nameserver addresses. The account’s entitlement determines the maximum value. Nameserver sets with the same ip_set and advanced value may reuse addresses; otherwise, they use disjoint address groups.

formatint64
minimum1
nameservers: List[DNSSettingsNameserverSetStandardResponseNameserver]
ipv4: List[str]

IPv4 addresses assigned to the nameserver.

ipv6: List[str]

IPv6 addresses assigned to the nameserver.

name: str

A unique lowercase Punycode nameserver name within the set.

class DNSSettingsNameserverSetAdvancedResponse: …
id: str

Identifier for a nameserver set.

maxLength32
minLength32
advanced: Literal[true]

Whether the nameserver set uses Advanced anycast groups.

created_on: datetime

When the nameserver set was created.

formatdate-time
ip_set: int

Selects the account-specific IP set that supplies the nameserver addresses. The account’s entitlement determines the maximum value. Nameserver sets with the same ip_set and advanced value may reuse addresses; otherwise, they use disjoint address groups.

formatint64
minimum1
nameservers: List[DNSSettingsNameserverSetAdvancedResponseNameserver]
ipv4: List[str]

IPv4 addresses assigned to the nameserver.

ipv4_groups: List[Literal["a", "b", "c"]]

Advanced anycast group for each address in the corresponding address array. Entries have the same order as, and correspond one-to-one with, the addresses.

One of the following:
"a"
"b"
"c"
ipv6: List[str]

IPv6 addresses assigned to the nameserver.

ipv6_groups: List[Literal["a", "b", "c"]]

Advanced anycast group for each address in the corresponding address array. Entries have the same order as, and correspond one-to-one with, the addresses.

One of the following:
"a"
"b"
"c"
name: str

A unique lowercase Punycode nameserver name within the set.

One of the following:
class DNSSettingsNameserverSetStandardResponse: …
id: str

Identifier for a nameserver set.

maxLength32
minLength32
advanced: Literal[false]

Whether the nameserver set uses Advanced anycast groups.

created_on: datetime

When the nameserver set was created.

formatdate-time
ip_set: int

Selects the account-specific IP set that supplies the nameserver addresses. The account’s entitlement determines the maximum value. Nameserver sets with the same ip_set and advanced value may reuse addresses; otherwise, they use disjoint address groups.

formatint64
minimum1
nameservers: List[DNSSettingsNameserverSetStandardResponseNameserver]
ipv4: List[str]

IPv4 addresses assigned to the nameserver.

ipv6: List[str]

IPv6 addresses assigned to the nameserver.

name: str

A unique lowercase Punycode nameserver name within the set.

class DNSSettingsNameserverSetAdvancedResponse: …
id: str

Identifier for a nameserver set.

maxLength32
minLength32
advanced: Literal[true]

Whether the nameserver set uses Advanced anycast groups.

created_on: datetime

When the nameserver set was created.

formatdate-time
ip_set: int

Selects the account-specific IP set that supplies the nameserver addresses. The account’s entitlement determines the maximum value. Nameserver sets with the same ip_set and advanced value may reuse addresses; otherwise, they use disjoint address groups.

formatint64
minimum1
nameservers: List[DNSSettingsNameserverSetAdvancedResponseNameserver]
ipv4: List[str]

IPv4 addresses assigned to the nameserver.

ipv4_groups: List[Literal["a", "b", "c"]]

Advanced anycast group for each address in the corresponding address array. Entries have the same order as, and correspond one-to-one with, the addresses.

One of the following:
"a"
"b"
"c"
ipv6: List[str]

IPv6 addresses assigned to the nameserver.

ipv6_groups: List[Literal["a", "b", "c"]]

Advanced anycast group for each address in the corresponding address array. Entries have the same order as, and correspond one-to-one with, the addresses.

One of the following:
"a"
"b"
"c"
name: str

A unique lowercase Punycode nameserver name within the set.

One of the following:
class DNSSettingsNameserverSetStandardResponse: …
id: str

Identifier for a nameserver set.

maxLength32
minLength32
advanced: Literal[false]

Whether the nameserver set uses Advanced anycast groups.

created_on: datetime

When the nameserver set was created.

formatdate-time
ip_set: int

Selects the account-specific IP set that supplies the nameserver addresses. The account’s entitlement determines the maximum value. Nameserver sets with the same ip_set and advanced value may reuse addresses; otherwise, they use disjoint address groups.

formatint64
minimum1
nameservers: List[DNSSettingsNameserverSetStandardResponseNameserver]
ipv4: List[str]

IPv4 addresses assigned to the nameserver.

ipv6: List[str]

IPv6 addresses assigned to the nameserver.

name: str

A unique lowercase Punycode nameserver name within the set.

class DNSSettingsNameserverSetAdvancedResponse: …
id: str

Identifier for a nameserver set.

maxLength32
minLength32
advanced: Literal[true]

Whether the nameserver set uses Advanced anycast groups.

created_on: datetime

When the nameserver set was created.

formatdate-time
ip_set: int

Selects the account-specific IP set that supplies the nameserver addresses. The account’s entitlement determines the maximum value. Nameserver sets with the same ip_set and advanced value may reuse addresses; otherwise, they use disjoint address groups.

formatint64
minimum1
nameservers: List[DNSSettingsNameserverSetAdvancedResponseNameserver]
ipv4: List[str]

IPv4 addresses assigned to the nameserver.

ipv4_groups: List[Literal["a", "b", "c"]]

Advanced anycast group for each address in the corresponding address array. Entries have the same order as, and correspond one-to-one with, the addresses.

One of the following:
"a"
"b"
"c"
ipv6: List[str]

IPv6 addresses assigned to the nameserver.

ipv6_groups: List[Literal["a", "b", "c"]]

Advanced anycast group for each address in the corresponding address array. Entries have the same order as, and correspond one-to-one with, the addresses.

One of the following:
"a"
"b"
"c"
name: str

A unique lowercase Punycode nameserver name within the set.

class NameserverSetDeleteResponse: …
id: str

Identifier for a nameserver set.

maxLength32
minLength32

SettingsAccountViews

List Internal DNS Views
dns.settings.account.views.list(ViewListParams**kwargs) -> SyncV4PagePaginationArray[ViewListResponse]
GET/accounts/{account_id}/dns_settings/views
DNS Internal View Details
dns.settings.account.views.get(strview_id, ViewGetParams**kwargs) -> ViewGetResponse
GET/accounts/{account_id}/dns_settings/views/{view_id}
Create Internal DNS View
dns.settings.account.views.create(ViewCreateParams**kwargs) -> ViewCreateResponse
POST/accounts/{account_id}/dns_settings/views
Update Internal DNS View
dns.settings.account.views.edit(strview_id, ViewEditParams**kwargs) -> ViewEditResponse
PATCH/accounts/{account_id}/dns_settings/views/{view_id}
Delete Internal DNS View
dns.settings.account.views.delete(strview_id, ViewDeleteParams**kwargs) -> ViewDeleteResponse
DELETE/accounts/{account_id}/dns_settings/views/{view_id}
ModelsExpand Collapse
class ViewListResponse: …
id: str

Identifier.

maxLength32
created_time: datetime

When the view was created.

formatdate-time
modified_time: datetime

When the view was last modified.

formatdate-time
name: str

The name of the view.

maxLength255
minLength1
zones: List[str]

The list of zones linked to this view.

class ViewGetResponse: …
id: str

Identifier.

maxLength32
created_time: datetime

When the view was created.

formatdate-time
modified_time: datetime

When the view was last modified.

formatdate-time
name: str

The name of the view.

maxLength255
minLength1
zones: List[str]

The list of zones linked to this view.

class ViewCreateResponse: …
id: str

Identifier.

maxLength32
created_time: datetime

When the view was created.

formatdate-time
modified_time: datetime

When the view was last modified.

formatdate-time
name: str

The name of the view.

maxLength255
minLength1
zones: List[str]

The list of zones linked to this view.

class ViewEditResponse: …
id: str

Identifier.

maxLength32
created_time: datetime

When the view was created.

formatdate-time
modified_time: datetime

When the view was last modified.

formatdate-time
name: str

The name of the view.

maxLength255
minLength1
zones: List[str]

The list of zones linked to this view.

class ViewDeleteResponse: …
id: Optional[str]

Identifier.

maxLength32