dns
Creates, updates, deletes, gets or lists a dns resource.
Overview
| Name | dns |
| Type | Resource |
| Id | cloudflare.email_routing.dns |
Fields
The following fields are returned by SELECT queries:
- list
Email Routing - DNS settings 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 | zone_id | subdomain | Show the DNS records needed to configure your Email Routing zone. |
create | insert | zone_id | Enable you Email Routing zone. Add and lock the necessary MX and SPF records. | |
edit | update | zone_id | Unlock MX Records previously locked by Email Routing. | |
email_routing_settings_disable_email_routing_dns | delete | zone_id | Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work. |
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. |
subdomain | string |
SELECT examples
- list
Show the DNS records needed to configure your Email Routing zone.
SELECT
name,
content,
priority,
ttl,
type
FROM cloudflare.email_routing.dns
WHERE zone_id = '{{ zone_id }}' -- required
AND subdomain = '{{ subdomain }}'
;
INSERT examples
- create
- Manifest
Enable you Email Routing zone. Add and lock the necessary MX and SPF records.
INSERT INTO cloudflare.email_routing.dns (
name,
zone_id
)
SELECT
'{{ name }}',
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: dns
props:
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the dns resource.
- name: name
value: "{{ name }}"
description: |
Domain of your zone.
UPDATE examples
- edit
Unlock MX Records previously locked by Email Routing.
UPDATE cloudflare.email_routing.dns
SET
name = '{{ name }}'
WHERE
zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- email_routing_settings_disable_email_routing_dns
Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.
DELETE FROM cloudflare.email_routing.dns
WHERE zone_id = '{{ zone_id }}' --required
;