Skip to main content

dns_records

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

Overview

Namedns_records
TypeResource
Idnetlify.dns.dns_records

Fields

The following fields are returned by SELECT queries:

get a single DNS record

NameDatatypeDescription
idstring
dns_zone_idstring
site_idstring
flaginteger
hostnamestring
managedboolean
priorityinteger (int64)
tagstring
ttlinteger (int64)
typestring
valuestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectzone_id, dns_record_id
listselectzone_id
createinsertzone_id
deletedeletezone_id, dns_record_id

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
dns_record_idstring
zone_idstring

SELECT examples

get a single DNS record

SELECT
id,
dns_zone_id,
site_id,
flag,
hostname,
managed,
priority,
tag,
ttl,
type,
value
FROM netlify.dns.dns_records
WHERE zone_id = '{{ zone_id }}' -- required
AND dns_record_id = '{{ dns_record_id }}' -- required
;

INSERT examples

No description available.

INSERT INTO netlify.dns.dns_records (
type,
hostname,
value,
ttl,
priority,
weight,
port,
flag,
tag,
zone_id
)
SELECT
'{{ type }}',
'{{ hostname }}',
'{{ value }}',
{{ ttl }},
{{ priority }},
{{ weight }},
{{ port }},
{{ flag }},
'{{ tag }}',
'{{ zone_id }}'
RETURNING
id,
dns_zone_id,
site_id,
flag,
hostname,
managed,
priority,
tag,
ttl,
type,
value
;

DELETE examples

No description available.

DELETE FROM netlify.dns.dns_records
WHERE zone_id = '{{ zone_id }}' --required
AND dns_record_id = '{{ dns_record_id }}' --required
;