Skip to main content

peers

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

Overview

Namepeers
TypeResource
Idcloudflare.dns.peers

Fields

The following fields are returned by SELECT queries:

Peer Details response.

NameDatatypeDescription
idstring (example: 23ff594956f20c2a721606e94745a8aa)
namestringThe name of the peer. (example: my-peer-1)
tsig_idstringTSIG authentication will be used for zone transfer if configured. (example: 69cd1e104af3e6ed3cb344f263fd0d5a)
ipstringIPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. (example: 192.0.2.53)
ixfr_enablebooleanEnable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones.
portnumberDNS port of primary or secondary nameserver, depending on what zone this peer is linked to.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectpeer_id, account_idGet Peer.
listselectaccount_idList Peers.
createinsertaccount_id, nameCreate Peer.
updatereplacepeer_id, account_id, nameModify Peer.
deletedeletepeer_id, account_idDelete Peer.

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
account_idstringThe Cloudflare account ID.
peer_idstring

SELECT examples

Get Peer.

SELECT
id,
name,
tsig_id,
ip,
ixfr_enable,
port
FROM cloudflare.dns.peers
WHERE peer_id = '{{ peer_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Create Peer.

INSERT INTO cloudflare.dns.peers (
name,
account_id
)
SELECT
'{{ name }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Modify Peer.

REPLACE cloudflare.dns.peers
SET
ip = '{{ ip }}',
ixfr_enable = {{ ixfr_enable }},
name = '{{ name }}',
port = {{ port }},
tsig_id = '{{ tsig_id }}'
WHERE
peer_id = '{{ peer_id }}' --required
AND account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Delete Peer.

DELETE FROM cloudflare.dns.peers
WHERE peer_id = '{{ peer_id }}' --required
AND account_id = '{{ account_id }}' --required
;