dns
Creates, updates, deletes, gets or lists a dns resource.
Overview
| Name | dns |
| Type | Resource |
| Id | cloudflare.email_sending.dns |
Fields
The following fields are returned by SELECT queries:
- list
Get sending subdomain DNS records response
| Name | Datatype | Description |
|---|---|---|
name | string | DNS record name (or @ for the zone apex). (example: example.com) |
content | string | DNS record content. (example: route1.mx.cloudflare.net) |
priority | number | Required for MX, SRV and URI records. Unused by other record types. Records with lower priorities are preferred. |
ttl | number | Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 for 'automatic'. (1) |
type | string | DNS 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | subdomain_id, zone_id | Returns the expected DNS records for a sending subdomain. | |
email_sending_subdomains_fix_sending_subdomain_dns | insert | subdomain_id, zone_id | 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. |
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 |
|---|---|---|
subdomain_id | string | |
zone_id | string | The Cloudflare zone ID. |
SELECT examples
- list
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
- email_sending_subdomains_fix_sending_subdomain_dns
- Manifest
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
;
# Description fields are for documentation purposes
- name: dns
props:
- name: subdomain_id
value: "{{ subdomain_id }}"
description: Required parameter for the dns resource.
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the dns resource.