Record Sets - Create Or Update
Creates or updates a record set within a DNS zone.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}?api-version=2018-05-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
record
|
path | True |
The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). |
|
relative
|
path | True |
|
The name of the record set, relative to the name of the zone. |
resource
|
path | True |
|
The name of the resource group. |
subscription
|
path | True |
|
Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. |
zone
|
path | True |
|
The name of the DNS zone (without a terminating dot). |
api-version
|
query | True |
|
Specifies the API version. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
If-Match |
|
The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. |
|
If-None-Match |
|
Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored. |
Request Body
Name | Type | Description |
---|---|---|
etag |
|
The etag of the record set. |
properties.AAAARecords |
The list of AAAA records in the record set. |
|
properties.ARecords |
|
The list of A records in the record set. |
properties.CNAMERecord |
The CNAME record in the record set. |
|
properties.MXRecords |
|
The list of MX records in the record set. |
properties.NSRecords |
|
The list of NS records in the record set. |
properties.PTRRecords |
The list of PTR records in the record set. |
|
properties.SOARecord |
The SOA record in the record set. |
|
properties.SRVRecords |
The list of SRV records in the record set. |
|
properties.TTL |
|
The TTL (time-to-live) of the records in the record set. |
properties.TXTRecords |
The list of TXT records in the record set. |
|
properties.caaRecords |
The list of CAA records in the record set. |
|
properties.metadata |
|
The metadata attached to the record set. |
properties.targetResource |
A reference to an azure resource from where the dns resource value is taken. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The record set has been updated. |
|
201 Created |
The record set has been created. |
|
Other Status Codes |
Default response. It will be deserialized as per the Error definition. |
Examples
Create A recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"ARecords": [
{
"ipv4Address": "127.0.0.1"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/A",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"ARecords": [
{
"ipv4Address": "127.0.0.1"
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/A",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"ARecords": [
{
"ipv4Address": "127.0.0.1"
}
]
}
}
Create A recordset with alias target resource
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"targetResource": {
"id": "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/A",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"targetResource": {
"id": "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
},
"provisioningState": "Succeeded"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/A/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/A",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"targetResource": {
"id": "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"
},
"provisioningState": "Succeeded"
}
}
Create AAAA recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"AAAARecords": [
{
"ipv6Address": "::1"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/AAAA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"AAAARecords": [
{
"ipv6Address": "::1"
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/AAAA/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/AAAA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"AAAARecords": [
{
"ipv6Address": "::1"
}
]
}
}
Create CAA recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"caaRecords": [
{
"flags": 0,
"tag": "issue",
"value": "ca.contoso.com"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/CAA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"caaRecords": [
{
"flags": 0,
"tag": "issue",
"value": "ca.contoso.com"
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CAA/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/CAA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"caaRecords": [
{
"flags": 0,
"tag": "issue",
"value": "ca.contoso.com"
}
]
}
}
Create CNAME recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"CNAMERecord": {
"cname": "contoso.com"
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/CNAME",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"CNAMERecord": {
"cname": "contoso.com"
}
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/CNAME/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/CNAME",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"CNAMERecord": {
"cname": "contoso.com"
}
}
}
Create MX recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"MXRecords": [
{
"preference": 0,
"exchange": "mail.contoso.com"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/MX",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"MXRecords": [
{
"preference": 0,
"exchange": "mail.contoso.com"
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/MX/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/MX",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"MXRecords": [
{
"preference": 0,
"exchange": "mail.contoso.com"
}
]
}
}
Create NS recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"NSRecords": [
{
"nsdname": "ns1.contoso.com"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/NS",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"NSRecords": [
{
"nsdname": "ns1.contoso.com"
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/NS/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/NS",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"NSRecords": [
{
"nsdname": "ns1.contoso.com"
}
]
}
}
Create PTR recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR/1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"PTRRecords": [
{
"ptrdname": "localhost"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR/1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "1",
"type": "Microsoft.Network/dnsZones/PTR",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "1.0.0.127.in-addr.arpa",
"PTRRecords": [
{
"ptrdname": "localhost"
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/0.0.127.in-addr.arpa/PTR/1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "1",
"type": "Microsoft.Network/dnsZones/PTR",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "1.0.0.127.in-addr.arpa",
"PTRRecords": [
{
"ptrdname": "localhost"
}
]
}
}
Create SOA recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA/@?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"SOARecord": {
"host": "ns1.contoso.com",
"email": "hostmaster.contoso.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTTL": 300
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA/@",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "@",
"type": "Microsoft.Network/dnsZones/SOA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "zone1",
"SOARecord": {
"host": "ns1.contoso.com",
"email": "hostmaster.contoso.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTTL": 300
}
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SOA/@",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "@",
"type": "Microsoft.Network/dnsZones/SOA",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "zone1",
"SOARecord": {
"host": "ns1.contoso.com",
"email": "hostmaster.contoso.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTTL": 300
}
}
}
Create SRV recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"SRVRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/SRV",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"SRVRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/SRV/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/SRV",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"SRVRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
Create TXT recordset
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1?api-version=2018-05-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"TXTRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/TXT",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"TXTRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1/TXT/record1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "record1",
"type": "Microsoft.Network/dnsZones/TXT",
"properties": {
"metadata": {
"key1": "value1"
},
"TTL": 3600,
"fqdn": "record1.zone1",
"TXTRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
Definitions
Aaaa |
An AAAA record. |
ARecord |
An A record. |
Caa |
A CAA record. |
Cloud |
An error response from the service. |
Cloud |
An error response from the service. |
Cname |
A CNAME record. |
Mx |
An MX record. |
Ns |
An NS record. |
Ptr |
A PTR record. |
Record |
Describes a DNS record set (a collection of DNS records with the same name and type). |
Record |
The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). |
Soa |
An SOA record. |
Srv |
An SRV record. |
Sub |
A reference to a another resource |
Txt |
A TXT record. |
AaaaRecord
An AAAA record.
Name | Type | Description |
---|---|---|
ipv6Address |
|
The IPv6 address of this AAAA record. |
ARecord
An A record.
Name | Type | Description |
---|---|---|
ipv4Address |
|
The IPv4 address of this A record. |
CaaRecord
A CAA record.
Name | Type | Description |
---|---|---|
flags |
|
The flags for this CAA record as an integer between 0 and 255. |
tag |
|
The tag for this CAA record. |
value |
|
The value for this CAA record. |
CloudError
An error response from the service.
Name | Type | Description |
---|---|---|
error |
Cloud error body. |
CloudErrorBody
An error response from the service.
Name | Type | Description |
---|---|---|
code |
|
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
details |
A list of additional details about the error. |
|
message |
|
A message describing the error, intended to be suitable for display in a user interface. |
target |
|
The target of the particular error. For example, the name of the property in error. |
CnameRecord
A CNAME record.
Name | Type | Description |
---|---|---|
cname |
|
The canonical name for this CNAME record. |
MxRecord
An MX record.
Name | Type | Description |
---|---|---|
exchange |
|
The domain name of the mail host for this MX record. |
preference |
|
The preference value for this MX record. |
NsRecord
An NS record.
Name | Type | Description |
---|---|---|
nsdname |
|
The name server name for this NS record. |
PtrRecord
A PTR record.
Name | Type | Description |
---|---|---|
ptrdname |
|
The PTR target domain name for this PTR record. |
RecordSet
Describes a DNS record set (a collection of DNS records with the same name and type).
Name | Type | Description |
---|---|---|
etag |
|
The etag of the record set. |
id |
|
The ID of the record set. |
name |
|
The name of the record set. |
properties.AAAARecords |
The list of AAAA records in the record set. |
|
properties.ARecords |
|
The list of A records in the record set. |
properties.CNAMERecord |
The CNAME record in the record set. |
|
properties.MXRecords |
|
The list of MX records in the record set. |
properties.NSRecords |
|
The list of NS records in the record set. |
properties.PTRRecords |
The list of PTR records in the record set. |
|
properties.SOARecord |
The SOA record in the record set. |
|
properties.SRVRecords |
The list of SRV records in the record set. |
|
properties.TTL |
|
The TTL (time-to-live) of the records in the record set. |
properties.TXTRecords |
The list of TXT records in the record set. |
|
properties.caaRecords |
The list of CAA records in the record set. |
|
properties.fqdn |
|
Fully qualified domain name of the record set. |
properties.metadata |
|
The metadata attached to the record set. |
properties.provisioningState |
|
provisioning State of the record set. |
properties.targetResource |
A reference to an azure resource from where the dns resource value is taken. |
|
type |
|
The type of the record set. |
RecordType
The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
Name | Type | Description |
---|---|---|
A |
|
|
AAAA |
|
|
CAA |
|
|
CNAME |
|
|
MX |
|
|
NS |
|
|
PTR |
|
|
SOA |
|
|
SRV |
|
|
TXT |
|
SoaRecord
An SOA record.
Name | Type | Description |
---|---|---|
|
The email contact for this SOA record. |
|
expireTime |
|
The expire time for this SOA record. |
host |
|
The domain name of the authoritative name server for this SOA record. |
minimumTTL |
|
The minimum value for this SOA record. By convention this is used to determine the negative caching duration. |
refreshTime |
|
The refresh value for this SOA record. |
retryTime |
|
The retry time for this SOA record. |
serialNumber |
|
The serial number for this SOA record. |
SrvRecord
An SRV record.
Name | Type | Description |
---|---|---|
port |
|
The port value for this SRV record. |
priority |
|
The priority value for this SRV record. |
target |
|
The target domain name for this SRV record. |
weight |
|
The weight value for this SRV record. |
SubResource
A reference to a another resource
Name | Type | Description |
---|---|---|
id |
|
Resource Id. |
TxtRecord
A TXT record.
Name | Type | Description |
---|---|---|
value |
|
The text value of this TXT record. |