dns_records
Creates, updates, deletes, gets or lists a dns_records resource.
Overview
| Name | dns_records |
| Type | Resource |
| Id | cloudflare.dns.dns_records |
Fields
The following fields are returned by SELECT queries:
- list
Export DNS Records response
| Name | Datatype | Description |
|---|---|---|
contents | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | zone_id | You can export your BIND config through this endpoint. See the documentation for more information. | |
batch | exec | zone_id | Send a Batch of DNS Record API calls to be executed together. Notes: - Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See the documentation for more information. - The operations you specify within the /batch request body are always executed in the following order: - Deletes - Patches - Puts - Posts | |
import | exec | zone_id, file | You can upload your BIND config through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See the documentation for more information. | |
scan | exec | zone_id | Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet. |
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
You can export your BIND config through this endpoint. See the documentation for more information.
SELECT
contents
FROM cloudflare.dns.dns_records
WHERE zone_id = '{{ zone_id }}' -- required
;
Lifecycle Methods
- batch
- import
- scan
Send a Batch of DNS Record API calls to be executed together. Notes: - Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See the documentation for more information. - The operations you specify within the /batch request body are always executed in the following order: - Deletes - Patches - Puts - Posts
EXEC cloudflare.dns.dns_records.batch
@zone_id='{{ zone_id }}' --required
@@json=
'{
"deletes": "{{ deletes }}",
"patches": "{{ patches }}",
"posts": "{{ posts }}",
"puts": "{{ puts }}"
}'
;
You can upload your BIND config through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See the documentation for more information.
EXEC cloudflare.dns.dns_records.import
@zone_id='{{ zone_id }}' --required
@@json=
'{
"file": "{{ file }}",
"proxied": "{{ proxied }}"
}'
;
Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet.
EXEC cloudflare.dns.dns_records.scan
@zone_id='{{ zone_id }}' --required
;