Skip to main content

dns

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

Overview

Namedns
TypeResource
Idcloudflare.email_sending.dns

Fields

The following fields are returned by SELECT queries:

Get sending subdomain DNS records response

NameDatatypeDescription
namestringDNS record name (or @ for the zone apex). (example: example.com)
contentstringDNS record content. (example: route1.mx.cloudflare.net)
prioritynumberRequired for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred.
ttlnumberTime to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. (1)
typestringDNS record type. (A, AAAA, CNAME, HTTPS, TXT, SRV, LOC, MX, NS, CERT, DNSKEY, DS, NAPTR, SMIMEA, SSHFP, SVCB, TLSA, URI) (example: NS)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectsubdomain_id, zone_idReturns the expected DNS records for a sending subdomain.
email_sending_subdomains_fix_sending_subdomain_dnsinsertsubdomain_id, zone_idIdempotently re-applies the sending DNS records (creates missing records, re-applies the email_routing lock on records whose lock has been cleared). Refuses with a 409 if foreign MX, multiple SPF, multiple DMARC, or multiple DKIM records exist at the relevant DNS names — those require manual cleanup.

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
subdomain_idstring
zone_idstringThe Cloudflare zone ID.

SELECT examples

Returns the expected DNS records for a sending subdomain.

SELECT
name,
content,
priority,
ttl,
type
FROM cloudflare.email_sending.dns
WHERE subdomain_id = '{{ subdomain_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;

INSERT examples

Idempotently re-applies the sending DNS records (creates missing records, re-applies the email_routing lock on records whose lock has been cleared). Refuses with a 409 if foreign MX, multiple SPF, multiple DMARC, or multiple DKIM records exist at the relevant DNS names — those require manual cleanup.

INSERT INTO cloudflare.email_sending.dns (
subdomain_id,
zone_id
)
SELECT
'{{ subdomain_id }}',
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;