Skip to main content

dns_records

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

Overview

Namedns_records
TypeResource
Idcloudflare.dns.dns_records

Fields

The following fields are returned by SELECT queries:

Export DNS Records response

NameDatatypeDescription
contentsstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectzone_idYou can export your BIND config through this endpoint. See the documentation for more information.
batchexeczone_idSend 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
importexeczone_id, fileYou 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.
scanexeczone_idScan 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.

NameDatatypeDescription
zone_idstringThe Cloudflare zone ID.

SELECT examples

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

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 }}"
}'
;