# Settings # Zone ## Show DNS Settings `dns.settings.zone.get(ZoneGetParams**kwargs) -> ZoneGetResponse` **get** `/zones/{zone_id}/dns_settings` Show DNS settings for a zone ### Parameters - `zone_id: str` Identifier. ### Returns - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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` Settings determining the nameservers through which the zone should be available. - `type: Literal["cloudflare.standard", "custom.account", "custom.tenant", "custom.zone"]` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set: Optional[int]` Configured nameserver set to be used for this zone - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) zone = client.dns.settings.zone.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(zone.multi_provider) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard", "ns_set": 1 }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } ``` ## Update DNS Settings `dns.settings.zone.edit(ZoneEditParams**kwargs) -> ZoneEditResponse` **patch** `/zones/{zone_id}/dns_settings` Update DNS settings for a zone ### Parameters - `zone_id: str` Identifier. - `flatten_all_cnames: Optional[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. - `foundation_dns: Optional[bool]` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: Optional[InternalDNS]` Settings for this internal zone. - `reference_zone_id: Optional[str]` The ID of the zone to fallback to. - `multi_provider: Optional[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: Optional[Nameservers]` Settings determining the nameservers through which the zone should be available. - `ns_set: Optional[int]` Configured nameserver set to be used for this zone - `type: Optional[Literal["cloudflare.standard", "custom.account", "custom.tenant", "custom.zone"]]` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_ttl: Optional[float]` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: Optional[bool]` Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `soa: Optional[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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Optional[Literal["standard", "cdn_only", "dns_only"]]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Returns - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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` Settings determining the nameservers through which the zone should be available. - `type: Literal["cloudflare.standard", "custom.account", "custom.tenant", "custom.zone"]` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set: Optional[int]` Configured nameserver set to be used for this zone - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.dns.settings.zone.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.multi_provider) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard", "ns_set": 1 }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } ``` ## Domain Types ### Zone Get Response - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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` Settings determining the nameservers through which the zone should be available. - `type: Literal["cloudflare.standard", "custom.account", "custom.tenant", "custom.zone"]` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set: Optional[int]` Configured nameserver set to be used for this zone - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Zone Edit Response - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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` Settings determining the nameservers through which the zone should be available. - `type: Literal["cloudflare.standard", "custom.account", "custom.tenant", "custom.zone"]` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set: Optional[int]` Configured nameserver set to be used for this zone - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` # Account ## Show DNS Settings `dns.settings.account.get(AccountGetParams**kwargs) -> AccountGetResponse` **get** `/accounts/{account_id}/dns_settings` Show DNS settings for an account ### Parameters - `account_id: str` Identifier. ### Returns - `class AccountGetResponse: …` - `zone_defaults: ZoneDefaults` - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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.standard.random", "custom.account", "custom.tenant"]` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) account = client.dns.settings.account.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(account.zone_defaults) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "zone_defaults": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard" }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } } ``` ## Update DNS Settings `dns.settings.account.edit(AccountEditParams**kwargs) -> AccountEditResponse` **patch** `/accounts/{account_id}/dns_settings` Update DNS settings for an account ### Parameters - `account_id: str` Identifier. - `zone_defaults: Optional[ZoneDefaults]` - `flatten_all_cnames: Optional[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. - `foundation_dns: Optional[bool]` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: Optional[ZoneDefaultsInternalDNS]` Settings for this internal zone. - `reference_zone_id: Optional[str]` The ID of the zone to fallback to. - `multi_provider: Optional[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: Optional[ZoneDefaultsNameservers]` Settings determining the nameservers through which the zone should be available. - `type: Optional[Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant"]]` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: Optional[float]` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: Optional[bool]` Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `soa: Optional[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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Optional[Literal["standard", "cdn_only", "dns_only"]]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Returns - `class AccountEditResponse: …` - `zone_defaults: ZoneDefaults` - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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.standard.random", "custom.account", "custom.tenant"]` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.dns.settings.account.edit( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.zone_defaults) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "zone_defaults": { "flatten_all_cnames": false, "foundation_dns": false, "internal_dns": { "reference_zone_id": "reference_zone_id" }, "multi_provider": false, "nameservers": { "type": "cloudflare.standard" }, "ns_ttl": 86400, "secondary_overrides": false, "soa": { "expire": 604800, "min_ttl": 1800, "mname": "kristina.ns.cloudflare.com", "refresh": 10000, "retry": 2400, "rname": "admin.example.com", "ttl": 3600 }, "zone_mode": "dns_only" } } } ``` ## Domain Types ### Account Get Response - `class AccountGetResponse: …` - `zone_defaults: ZoneDefaults` - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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.standard.random", "custom.account", "custom.tenant"]` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Account Edit Response - `class AccountEditResponse: …` - `zone_defaults: ZoneDefaults` - `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. - `foundation_dns: bool` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `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.standard.random", "custom.account", "custom.tenant"]` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: float` The time to live (TTL) of the zone's nameserver (NS) records. - `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. - `min_ttl: Optional[float]` The time to live (TTL) for negative caching of records within the zone. - `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. - `retry: Optional[float]` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `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. - `zone_mode: Literal["standard", "cdn_only", "dns_only"]` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` # Views ## List Internal DNS Views `dns.settings.account.views.list(ViewListParams**kwargs) -> SyncV4PagePaginationArray[ViewListResponse]` **get** `/accounts/{account_id}/dns_settings/views` List DNS Internal Views for an Account ### Parameters - `account_id: str` Identifier. - `direction: Optional[Literal["asc", "desc"]]` Direction to order DNS views in. - `"asc"` - `"desc"` - `match: Optional[Literal["any", "all"]]` Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. - `"any"` - `"all"` - `name: Optional[Name]` - `contains: Optional[str]` Substring of the DNS view name. - `endswith: Optional[str]` Suffix of the DNS view name. - `exact: Optional[str]` Exact value of the DNS view name. - `startswith: Optional[str]` Prefix of the DNS view name. - `order: Optional[Literal["name", "created_on", "modified_on"]]` Field to order DNS views by. - `"name"` - `"created_on"` - `"modified_on"` - `page: Optional[float]` Page number of paginated results. - `per_page: Optional[float]` Number of DNS views per page. - `zone_id: Optional[str]` A zone ID that exists in the zones list for the view. - `zone_name: Optional[str]` A zone name that exists in the zones list for the view. ### Returns - `class ViewListResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.dns.settings.account.views.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## DNS Internal View Details `dns.settings.account.views.get(strview_id, ViewGetParams**kwargs) -> ViewGetResponse` **get** `/accounts/{account_id}/dns_settings/views/{view_id}` Get DNS Internal View ### Parameters - `account_id: str` Identifier. - `view_id: str` Identifier. ### Returns - `class ViewGetResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) view = client.dns.settings.account.views.get( view_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(view.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } } ``` ## Create Internal DNS View `dns.settings.account.views.create(ViewCreateParams**kwargs) -> ViewCreateResponse` **post** `/accounts/{account_id}/dns_settings/views` Create Internal DNS View for an account ### Parameters - `account_id: str` Identifier. - `name: str` The name of the view. - `zones: SequenceNotStr[str]` The list of zones linked to this view. ### Returns - `class ViewCreateResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) view = client.dns.settings.account.views.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my view", zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) print(view.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } } ``` ## Update Internal DNS View `dns.settings.account.views.edit(strview_id, ViewEditParams**kwargs) -> ViewEditResponse` **patch** `/accounts/{account_id}/dns_settings/views/{view_id}` Update an existing Internal DNS View ### Parameters - `account_id: str` Identifier. - `view_id: str` Identifier. - `name: Optional[str]` The name of the view. - `zones: Optional[SequenceNotStr[str]]` The list of zones linked to this view. ### Returns - `class ViewEditResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.dns.settings.account.views.edit( view_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_time": "2014-01-01T05:20:00.12345Z", "modified_time": "2014-01-01T05:20:00.12345Z", "name": "my view", "zones": [ "372e67954025e0ba6aaa6d586b9e0b59" ] } } ``` ## Delete Internal DNS View `dns.settings.account.views.delete(strview_id, ViewDeleteParams**kwargs) -> ViewDeleteResponse` **delete** `/accounts/{account_id}/dns_settings/views/{view_id}` Delete an existing Internal DNS View ### Parameters - `account_id: str` Identifier. - `view_id: str` Identifier. ### Returns - `class ViewDeleteResponse: …` - `id: Optional[str]` Identifier. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) view = client.dns.settings.account.views.delete( view_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(view.id) ``` #### Response ```json { "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353" } } ``` ## Domain Types ### View List Response - `class ViewListResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### View Get Response - `class ViewGetResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### View Create Response - `class ViewCreateResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### View Edit Response - `class ViewEditResponse: …` - `id: str` Identifier. - `created_time: datetime` When the view was created. - `modified_time: datetime` When the view was last modified. - `name: str` The name of the view. - `zones: List[str]` The list of zones linked to this view. ### View Delete Response - `class ViewDeleteResponse: …` - `id: Optional[str]` Identifier.