Skip to main content

record_sets

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

Overview

Namerecord_sets
TypeResource
Idazure.dns.record_sets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the record set.
namestringThe name of the record set.
AAAARecordsarrayThe list of AAAA records in the record set.
ARecordsarrayThe list of A records in the record set.
CNAMERecordobjectThe CNAME record in the record set.
MXRecordsarrayThe list of MX records in the record set.
NSRecordsarrayThe list of NS records in the record set.
PTRRecordsarrayThe list of PTR records in the record set.
SOARecordobjectThe SOA record in the record set.
SRVRecordsarrayThe list of SRV records in the record set.
TTLintegerThe TTL (time-to-live) of the records in the record set.
TXTRecordsarrayThe list of TXT records in the record set.
caaRecordsarrayThe list of CAA records in the record set.
etagstringThe etag of the record set.
fqdnstringFully qualified domain name of the record set.
metadataobjectThe metadata attached to the record set.
provisioningStatestringprovisioning State of the record set.
targetResourceobjectA reference to a another resource.
typestringThe type of the record set.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, zone_name, relative_record_set_name, record_type, subscription_idGets a record set.
list_by_typeselectresource_group_name, zone_name, record_type, subscription_id$top, $recordsetnamesuffixLists the record sets of a specified type in a DNS zone.
list_by_dns_zoneselectresource_group_name, zone_name, subscription_id$top, $recordsetnamesuffixLists all record sets in a DNS zone.
create_or_updateinsertresource_group_name, zone_name, relative_record_set_name, record_type, subscription_idIf-Match, If-None-MatchCreates or updates a record set within a DNS zone.
updateupdateresource_group_name, zone_name, relative_record_set_name, record_type, subscription_idIf-MatchUpdates a record set within a DNS zone.
create_or_updatereplaceresource_group_name, zone_name, relative_record_set_name, record_type, subscription_idIf-Match, If-None-MatchCreates or updates a record set within a DNS zone.
deletedeleteresource_group_name, zone_name, relative_record_set_name, record_type, subscription_idIf-MatchDeletes a record set from a DNS zone. This operation cannot be undone.
list_all_by_dns_zoneexecresource_group_name, zone_name, subscription_id$top, $recordsetnamesuffixLists all record sets in a DNS zone.

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
record_typestringThe type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Known values are: "A", "AAAA", "CAA", "CNAME", "MX", "NS", "PTR", "SOA", "SRV", and "TXT". Required.
relative_record_set_namestringThe name of the record set, relative to the name of the zone. Required.
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
zone_namestringThe name of the DNS zone (without a terminating dot). Required.
$recordsetnamesuffixstringThe suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .\ . Default value is None.
$topintegerThe maximum number of record sets to return. If not specified, returns up to 100 record sets. Default value is None.
If-MatchstringThe etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. Default value is None.
If-None-MatchstringSet to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored. Default value is None.

SELECT examples

Gets a record set.

SELECT
id,
name,
AAAARecords,
ARecords,
CNAMERecord,
MXRecords,
NSRecords,
PTRRecords,
SOARecord,
SRVRecords,
TTL,
TXTRecords,
caaRecords,
etag,
fqdn,
metadata,
provisioningState,
targetResource,
type
FROM azure.dns.record_sets
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND zone_name = '{{ zone_name }}' -- required
AND relative_record_set_name = '{{ relative_record_set_name }}' -- required
AND record_type = '{{ record_type }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a record set within a DNS zone.

INSERT INTO azure.dns.record_sets (
etag,
properties,
resource_group_name,
zone_name,
relative_record_set_name,
record_type,
subscription_id,
If-Match,
If-None-Match
)
SELECT
'{{ etag }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ zone_name }}',
'{{ relative_record_set_name }}',
'{{ record_type }}',
'{{ subscription_id }}',
'{{ If-Match }}',
'{{ If-None-Match }}'
RETURNING
id,
name,
etag,
properties,
type
;

UPDATE examples

Updates a record set within a DNS zone.

UPDATE azure.dns.record_sets
SET
etag = '{{ etag }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND zone_name = '{{ zone_name }}' --required
AND relative_record_set_name = '{{ relative_record_set_name }}' --required
AND record_type = '{{ record_type }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
id,
name,
etag,
properties,
type;

REPLACE examples

Creates or updates a record set within a DNS zone.

REPLACE azure.dns.record_sets
SET
etag = '{{ etag }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND zone_name = '{{ zone_name }}' --required
AND relative_record_set_name = '{{ relative_record_set_name }}' --required
AND record_type = '{{ record_type }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND If-Match = '{{ If-Match}}'
AND If-None-Match = '{{ If-None-Match}}'
RETURNING
id,
name,
etag,
properties,
type;

DELETE examples

Deletes a record set from a DNS zone. This operation cannot be undone.

DELETE FROM azure.dns.record_sets
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND zone_name = '{{ zone_name }}' --required
AND relative_record_set_name = '{{ relative_record_set_name }}' --required
AND record_type = '{{ record_type }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND If-Match = '{{ If-Match }}'
;

Lifecycle Methods

Lists all record sets in a DNS zone.

EXEC azure.dns.record_sets.list_all_by_dns_zone 
@resource_group_name='{{ resource_group_name }}' --required,
@zone_name='{{ zone_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@$top='{{ $top }}',
@$recordsetnamesuffix='{{ $recordsetnamesuffix }}'
;