zone
Creates, updates, deletes, gets or lists a zone resource.
Overview
| Name | zone |
| Type | Resource |
| Id | cloudflare.dns.zone |
Fields
The following fields are returned by SELECT queries:
- list
Show DNS Settings response
| Name | Datatype | Description |
|---|---|---|
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 | object | Settings for this internal zone. |
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 | object | Settings determining the nameservers through which the zone should be available. |
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 | object | Components of the zone's SOA record. |
zone_mode | string | Whether the zone mode is a regular or CDN/DNS only zone. (standard, cdn_only, dns_only) (example: dns_only) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | zone_id | Show DNS settings for a zone | |
edit | update | zone_id | Update DNS settings for a zone |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
zone_id | string | The Cloudflare zone ID. |
SELECT examples
- list
Show DNS settings for a zone
SELECT
flatten_all_cnames,
foundation_dns,
internal_dns,
multi_provider,
nameservers,
ns_ttl,
secondary_overrides,
soa,
zone_mode
FROM cloudflare.dns.zone
WHERE zone_id = '{{ zone_id }}' -- required
;
UPDATE examples
- edit
Update DNS settings for a zone
UPDATE cloudflare.dns.zone
SET
flatten_all_cnames = {{ flatten_all_cnames }},
foundation_dns = {{ foundation_dns }},
internal_dns = '{{ internal_dns }}',
multi_provider = {{ multi_provider }},
ns_ttl = {{ ns_ttl }},
secondary_overrides = {{ secondary_overrides }},
soa = '{{ soa }}',
zone_mode = '{{ zone_mode }}',
nameservers = '{{ nameservers }}'
WHERE
zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;