Skip to main content

zone

Creates, updates, deletes, gets or lists a zone resource.

Overview

Namezone
TypeResource
Idcloudflare.dns.zone

Fields

The following fields are returned by SELECT queries:

Show DNS Settings response

NameDatatypeDescription
flatten_all_cnamesbooleanWhether 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_dnsbooleanWhether to enable Foundation DNS Advanced Nameservers on the zone.
internal_dnsobjectSettings for this internal zone.
multi_providerbooleanWhether 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.
nameserversobjectSettings determining the nameservers through which the zone should be available.
ns_ttlnumberThe time to live (TTL) of the zone's nameserver (NS) records.
secondary_overridesbooleanAllows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.
soaobjectComponents of the zone's SOA record.
zone_modestringWhether 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:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectzone_idShow DNS settings for a zone
editupdatezone_idUpdate 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.

NameDatatypeDescription
zone_idstringThe Cloudflare zone ID.

SELECT examples

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

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;