Record Sets - Create Or Update
Creates or updates a record set within a Private DNS zone.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}/{recordType}/{relativeRecordSetName}?api-version=2018-09-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
private
|
path | True |
string |
The name of the Private DNS zone (without a terminating dot). |
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 Private DNS zone is created). |
|
relative
|
path | True |
string |
The name of the record set, relative to the name of the zone. |
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
path | True |
string |
Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
api-version
|
query | True |
string |
Client Api Version. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
If-Match |
string |
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 |
string |
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 |
string |
The ETag of the record set. |
properties.aRecords |
ARecord[] |
The list of A records in the record set. |
properties.aaaaRecords |
The list of AAAA records in the record set. |
|
properties.cnameRecord |
The CNAME record in the record set. |
|
properties.metadata |
object |
The metadata attached to the record set. |
properties.mxRecords |
Mx |
The list of MX 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 |
integer |
The TTL (time-to-live) of the records in the record set. |
properties.txtRecords |
The list of TXT records in the record set. |
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
PUT Private DNS Zone A Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recordA?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"aRecords": [
{
"ipv4Address": "1.2.3.4"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recorda",
"type": "Microsoft.Network/privateDnsZones/A",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recorda.privatezone1.com.",
"isAutoRegistered": false,
"aRecords": [
{
"ipv4Address": "1.2.3.4"
}
]
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/A/recorda",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recorda",
"type": "Microsoft.Network/privateDnsZones/A",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recorda.privatezone1.com.",
"isAutoRegistered": false,
"aRecords": [
{
"ipv4Address": "1.2.3.4"
}
]
}
}
PUT Private DNS Zone AAAA Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordAAAA?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"aaaaRecords": [
{
"ipv6Address": "::1"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordaaaa",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordaaaa",
"type": "Microsoft.Network/privateDnsZones/AAAA",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordaaaa.privatezone1.com.",
"isAutoRegistered": false,
"aaaaRecords": [
{
"ipv6Address": "::1"
}
]
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/AAAA/recordaaaa",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordaaaa",
"type": "Microsoft.Network/privateDnsZones/AAAA",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordaaaa.privatezone1.com.",
"isAutoRegistered": false,
"aaaaRecords": [
{
"ipv6Address": "::1"
}
]
}
}
PUT Private DNS Zone CNAME Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordCNAME?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"cnameRecord": {
"cname": "contoso.com"
}
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordcname",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordcname",
"type": "Microsoft.Network/privateDnsZones/CNAME",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordcname.privatezone1.com.",
"isAutoRegistered": false,
"cnameRecord": {
"cname": "contoso.com"
}
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/CNAME/recordcname",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordcname",
"type": "Microsoft.Network/privateDnsZones/CNAME",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordcname.privatezone1.com.",
"isAutoRegistered": false,
"cnameRecord": {
"cname": "contoso.com"
}
}
}
PUT Private DNS Zone MX Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordMX?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"mxRecords": [
{
"preference": 0,
"exchange": "mail.privatezone1.com"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordmx",
"type": "Microsoft.Network/privateDnsZones/MX",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordmx.privatezone1.com.",
"isAutoRegistered": false,
"mxRecords": [
{
"preference": 0,
"exchange": "mail.privatezone1.com"
}
]
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/MX/recordmx",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordmx",
"type": "Microsoft.Network/privateDnsZones/MX",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordmx.privatezone1.com.",
"isAutoRegistered": false,
"mxRecords": [
{
"preference": 0,
"exchange": "mail.privatezone1.com"
}
]
}
}
PUT Private DNS Zone PTR Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/0.0.127.in-addr.arpa/PTR/1?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"ptrRecords": [
{
"ptrdname": "localhost"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/0.0.127.in-addr.arpa/PTR/1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "1",
"type": "Microsoft.Network/privateDnsZones/PTR",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "1.0.0.127.in-addr.arpa.",
"isAutoRegistered": false,
"ptrRecords": [
{
"ptrdname": "localhost"
}
]
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/0.0.127.in-addr.arpa/PTR/1",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "1",
"type": "Microsoft.Network/privateDnsZones/PTR",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "1.0.0.127.in-addr.arpa.",
"isAutoRegistered": false,
"ptrRecords": [
{
"ptrdname": "localhost"
}
]
}
}
PUT Private DNS Zone SOA Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SOA/@?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"soaRecord": {
"host": "azureprivatedns.net",
"email": "azureprivatedns-hostmaster.microsoft.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTtl": 300
}
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SOA/@",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "@",
"type": "Microsoft.Network/privateDnsZones/SOA",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "privatezone1.com.",
"isAutoRegistered": false,
"soaRecord": {
"host": "azureprivatedns.net",
"email": "azureprivatedns-hostmaster.microsoft.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTtl": 300
}
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SOA/@",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "@",
"type": "Microsoft.Network/privateDnsZones/SOA",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "privatezone1.com.",
"isAutoRegistered": false,
"soaRecord": {
"host": "azureprivatedns.net",
"email": "azureprivatedns-hostmaster.microsoft.com",
"serialNumber": 1,
"refreshTime": 3600,
"retryTime": 300,
"expireTime": 2419200,
"minimumTtl": 300
}
}
}
PUT Private DNS Zone SRV Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SRV/recordSRV?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"srvRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SRV/recordsrv",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordsrv",
"type": "Microsoft.Network/privateDnsZones/SRV",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordsrv.privatezone1.com.",
"isAutoRegistered": false,
"srvRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/SRV/recordsrv",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordsrv",
"type": "Microsoft.Network/privateDnsZones/SRV",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordsrv.privatezone1.com.",
"isAutoRegistered": false,
"srvRecords": [
{
"priority": 0,
"weight": 10,
"port": 80,
"target": "contoso.com"
}
]
}
}
PUT Private DNS Zone TXT Record Set
Sample Request
PUT https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/TXT/recordTXT?api-version=2018-09-01
{
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"txtRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
Sample Response
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/TXT/recordtxt",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordtxt",
"type": "Microsoft.Network/privateDnsZones/TXT",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordtxt.privatezone1.com.",
"isAutoRegistered": false,
"txtRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
{
"id": "/subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.Network/privateDnsZones/privatezone1.com/TXT/recordtxt",
"etag": "00000000-0000-0000-0000-000000000000",
"name": "recordtxt",
"type": "Microsoft.Network/privateDnsZones/TXT",
"properties": {
"metadata": {
"key1": "value1"
},
"ttl": 3600,
"fqdn": "recordtxt.privatezone1.com.",
"isAutoRegistered": false,
"txtRecords": [
{
"value": [
"string1",
"string2"
]
}
]
}
}
Definitions
Name | Description |
---|---|
Aaaa |
An AAAA record. |
ARecord |
An A record. |
Cloud |
An error response from the service. |
Cloud |
An error response from the service. |
Cname |
A CNAME record. |
Mx |
An MX record. |
Ptr |
A PTR record. |
Record |
Describes a DNS record set (a collection of DNS records with the same name and type) in a Private DNS zone. |
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 Private DNS zone is created). |
Soa |
An SOA record. |
Srv |
An SRV record. |
Txt |
A TXT record. |
AaaaRecord
An AAAA record.
Name | Type | Description |
---|---|---|
ipv6Address |
string |
The IPv6 address of this AAAA record. |
ARecord
An A record.
Name | Type | Description |
---|---|---|
ipv4Address |
string |
The IPv4 address of this A 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 |
string |
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 |
string |
A message describing the error, intended to be suitable for display in a user interface. |
target |
string |
The target of the particular error. For example, the name of the property in error. |
CnameRecord
A CNAME record.
Name | Type | Description |
---|---|---|
cname |
string |
The canonical name for this CNAME record. |
MxRecord
An MX record.
Name | Type | Description |
---|---|---|
exchange |
string |
The domain name of the mail host for this MX record. |
preference |
integer |
The preference value for this MX record. |
PtrRecord
A PTR record.
Name | Type | Description |
---|---|---|
ptrdname |
string |
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) in a Private DNS zone.
Name | Type | Description |
---|---|---|
etag |
string |
The ETag of the record set. |
id |
string |
The ID of the record set. |
name |
string |
The name of the record set. |
properties.aRecords |
ARecord[] |
The list of A records in the record set. |
properties.aaaaRecords |
The list of AAAA records in the record set. |
|
properties.cnameRecord |
The CNAME record in the record set. |
|
properties.fqdn |
string |
Fully qualified domain name of the record set. |
properties.isAutoRegistered |
boolean |
Is the record set auto-registered in the Private DNS zone through a virtual network link? |
properties.metadata |
object |
The metadata attached to the record set. |
properties.mxRecords |
Mx |
The list of MX 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 |
integer |
The TTL (time-to-live) of the records in the record set. |
properties.txtRecords |
The list of TXT records in the record set. |
|
type |
string |
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 Private DNS zone is created).
Name | Type | Description |
---|---|---|
A |
string |
|
AAAA |
string |
|
CNAME |
string |
|
MX |
string |
|
PTR |
string |
|
SOA |
string |
|
SRV |
string |
|
TXT |
string |
SoaRecord
An SOA record.
Name | Type | Description |
---|---|---|
string |
The email contact for this SOA record. |
|
expireTime |
integer |
The expire time for this SOA record. |
host |
string |
The domain name of the authoritative name server for this SOA record. |
minimumTtl |
integer |
The minimum value for this SOA record. By convention this is used to determine the negative caching duration. |
refreshTime |
integer |
The refresh value for this SOA record. |
retryTime |
integer |
The retry time for this SOA record. |
serialNumber |
integer |
The serial number for this SOA record. |
SrvRecord
An SRV record.
Name | Type | Description |
---|---|---|
port |
integer |
The port value for this SRV record. |
priority |
integer |
The priority value for this SRV record. |
target |
string |
The target domain name for this SRV record. |
weight |
integer |
The weight value for this SRV record. |
TxtRecord
A TXT record.
Name | Type | Description |
---|---|---|
value |
string[] |
The text value of this TXT record. |