# Settings # Zone ## Show DNS Settings `client.dns.settings.zone.get(ZoneGetParamsparams, RequestOptionsoptions?): ZoneGetResponse` **get** `/zones/{zone_id}/dns_settings` Show DNS settings for a zone ### Parameters - `params: ZoneGetParams` - `zone_id: string` Identifier. ### Returns - `ZoneGetResponse` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "custom.account" | "custom.tenant" | "custom.zone"` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set?: number` Configured nameserver set to be used for this zone - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "standard" | "cdn_only" | "dns_only"` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const zone = await client.dns.settings.zone.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); console.log(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 `client.dns.settings.zone.edit(ZoneEditParamsparams, RequestOptionsoptions?): ZoneEditResponse` **patch** `/zones/{zone_id}/dns_settings` Update DNS settings for a zone ### Parameters - `params: ZoneEditParams` - `zone_id: string` Path param: Identifier. - `flatten_all_cnames?: boolean` Body param: 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?: boolean` Body param: Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns?: InternalDNS` Body param: Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider?: boolean` Body param: 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` Body param: Settings determining the nameservers through which the zone should be available. - `ns_set?: number` Configured nameserver set to be used for this zone - `type?: "cloudflare.standard" | "custom.account" | "custom.tenant" | "custom.zone"` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_ttl?: number` Body param: The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides?: boolean` Body param: Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex. - `soa?: SOA` Body param: Components of the zone's SOA record. - `expire?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode?: "standard" | "cdn_only" | "dns_only"` Body param: Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Returns - `ZoneEditResponse` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "custom.account" | "custom.tenant" | "custom.zone"` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set?: number` Configured nameserver set to be used for this zone - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "standard" | "cdn_only" | "dns_only"` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.dns.settings.zone.edit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 - `ZoneGetResponse` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "custom.account" | "custom.tenant" | "custom.zone"` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set?: number` Configured nameserver set to be used for this zone - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "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 - `ZoneEditResponse` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "custom.account" | "custom.tenant" | "custom.zone"` Nameserver type - `"cloudflare.standard"` - `"custom.account"` - `"custom.tenant"` - `"custom.zone"` - `ns_set?: number` Configured nameserver set to be used for this zone - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "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 `client.dns.settings.account.get(AccountGetParamsparams, RequestOptionsoptions?): AccountGetResponse` **get** `/accounts/{account_id}/dns_settings` Show DNS settings for an account ### Parameters - `params: AccountGetParams` - `account_id: string` Identifier. ### Returns - `AccountGetResponse` - `zone_defaults: ZoneDefaults` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "cloudflare.standard.random" | "custom.account" | "custom.tenant"` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "standard" | "cdn_only" | "dns_only"` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const account = await client.dns.settings.account.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 `client.dns.settings.account.edit(AccountEditParamsparams, RequestOptionsoptions?): AccountEditResponse` **patch** `/accounts/{account_id}/dns_settings` Update DNS settings for an account ### Parameters - `params: AccountEditParams` - `account_id: string` Path param: Identifier. - `zone_defaults?: ZoneDefaults` Body param - `flatten_all_cnames?: boolean` 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?: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns?: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider?: boolean` 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?: "cloudflare.standard" | "cloudflare.standard.random" | "custom.account" | "custom.tenant"` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl?: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides?: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode?: "standard" | "cdn_only" | "dns_only"` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Returns - `AccountEditResponse` - `zone_defaults: ZoneDefaults` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "cloudflare.standard.random" | "custom.account" | "custom.tenant"` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "standard" | "cdn_only" | "dns_only"` Whether the zone mode is a regular or CDN/DNS only zone. - `"standard"` - `"cdn_only"` - `"dns_only"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.dns.settings.account.edit({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 - `AccountGetResponse` - `zone_defaults: ZoneDefaults` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "cloudflare.standard.random" | "custom.account" | "custom.tenant"` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "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 - `AccountEditResponse` - `zone_defaults: ZoneDefaults` - `flatten_all_cnames: boolean` 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: boolean` Whether to enable Foundation DNS Advanced Nameservers on the zone. - `internal_dns: InternalDNS` Settings for this internal zone. - `reference_zone_id?: string` The ID of the zone to fallback to. - `multi_provider: boolean` 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: "cloudflare.standard" | "cloudflare.standard.random" | "custom.account" | "custom.tenant"` Nameserver type - `"cloudflare.standard"` - `"cloudflare.standard.random"` - `"custom.account"` - `"custom.tenant"` - `ns_ttl: number` The time to live (TTL) of the zone's nameserver (NS) records. - `secondary_overrides: boolean` 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?: number` Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone. - `min_ttl?: number` The time to live (TTL) for negative caching of records within the zone. - `mname?: string | null` The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used. - `refresh?: number` Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated. - `retry?: number` Time in seconds after which secondary servers should retry queries after the primary server was unresponsive. - `rname?: string` The email address of the zone administrator, with the first label representing the local part of the email address. - `ttl?: number` The time to live (TTL) of the SOA record itself. - `zone_mode: "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 `client.dns.settings.account.views.list(ViewListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/dns_settings/views` List DNS Internal Views for an Account ### Parameters - `params: ViewListParams` - `account_id: string` Path param: Identifier. - `direction?: "asc" | "desc"` Query param: Direction to order DNS views in. - `"asc"` - `"desc"` - `match?: "any" | "all"` Query param: 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?: Name` Query param - `contains?: string` Substring of the DNS view name. - `endswith?: string` Suffix of the DNS view name. - `exact?: string` Exact value of the DNS view name. - `startswith?: string` Prefix of the DNS view name. - `order?: "name" | "created_on" | "modified_on"` Query param: Field to order DNS views by. - `"name"` - `"created_on"` - `"modified_on"` - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Number of DNS views per page. - `zone_id?: string` Query param: A zone ID that exists in the zones list for the view. - `zone_name?: string` Query param: A zone name that exists in the zones list for the view. ### Returns - `ViewListResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const viewListResponse of client.dns.settings.account.views.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(viewListResponse.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 `client.dns.settings.account.views.get(stringviewId, ViewGetParamsparams, RequestOptionsoptions?): ViewGetResponse` **get** `/accounts/{account_id}/dns_settings/views/{view_id}` Get DNS Internal View ### Parameters - `viewId: string` Identifier. - `params: ViewGetParams` - `account_id: string` Identifier. ### Returns - `ViewGetResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const view = await client.dns.settings.account.views.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 `client.dns.settings.account.views.create(ViewCreateParamsparams, RequestOptionsoptions?): ViewCreateResponse` **post** `/accounts/{account_id}/dns_settings/views` Create Internal DNS View for an account ### Parameters - `params: ViewCreateParams` - `account_id: string` Path param: Identifier. - `name: string` Body param: The name of the view. - `zones: Array` Body param: The list of zones linked to this view. ### Returns - `ViewCreateResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const view = await client.dns.settings.account.views.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'my view', zones: ['372e67954025e0ba6aaa6d586b9e0b59'], }); console.log(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 `client.dns.settings.account.views.edit(stringviewId, ViewEditParamsparams, RequestOptionsoptions?): ViewEditResponse` **patch** `/accounts/{account_id}/dns_settings/views/{view_id}` Update an existing Internal DNS View ### Parameters - `viewId: string` Identifier. - `params: ViewEditParams` - `account_id: string` Path param: Identifier. - `name?: string` Body param: The name of the view. - `zones?: Array` Body param: The list of zones linked to this view. ### Returns - `ViewEditResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.dns.settings.account.views.edit('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(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 `client.dns.settings.account.views.delete(stringviewId, ViewDeleteParamsparams, RequestOptionsoptions?): ViewDeleteResponse` **delete** `/accounts/{account_id}/dns_settings/views/{view_id}` Delete an existing Internal DNS View ### Parameters - `viewId: string` Identifier. - `params: ViewDeleteParams` - `account_id: string` Identifier. ### Returns - `ViewDeleteResponse` - `id?: string` Identifier. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const view = await client.dns.settings.account.views.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(view.id); ``` #### Response ```json { "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353" } } ``` ## Domain Types ### View List Response - `ViewListResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### View Get Response - `ViewGetResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### View Create Response - `ViewCreateResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### View Edit Response - `ViewEditResponse` - `id: string` Identifier. - `created_time: string` When the view was created. - `modified_time: string` When the view was last modified. - `name: string` The name of the view. - `zones: Array` The list of zones linked to this view. ### View Delete Response - `ViewDeleteResponse` - `id?: string` Identifier.