Zones - Create Or Update

Creates or updates a DNS zone. Does not modify DNS records within the zone.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}?api-version=2018-05-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group.

subscriptionId
path True

string

Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription.

zoneName
path True

string

The name of the DNS zone (without a terminating dot).

api-version
query True

string

Specifies the API version.

Request Header

Name Required Type Description
If-Match

string

The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes.

If-None-Match

string

Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored.

Request Body

Name Required Type Description
location True

string

Resource location.

etag

string

The etag of the zone.

properties.registrationVirtualNetworks

SubResource[]

A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private.

properties.resolutionVirtualNetworks

SubResource[]

A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private.

properties.zoneType

ZoneType

The type of this DNS zone (Public or Private).

tags

object

Resource tags.

Responses

Name Type Description
200 OK

Zone

The DNS zone has been updated.

201 Created

Zone

The DNS zone has been created.

Other Status Codes

CloudError

Default response. It will be deserialized as per the Error definition.

Examples

Create zone

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1?api-version=2018-05-01

{
  "location": "Global",
  "tags": {
    "key1": "value1"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1",
  "etag": "00000000-0000-0000-0000-000000000000",
  "location": "global",
  "name": "zone1",
  "type": "Microsoft.Network/dnsZones",
  "properties": {
    "maxNumberOfRecordSets": 5000,
    "numberOfRecordSets": 2,
    "nameServers": [
      "ns1-01.azure-dns.com",
      "ns2-01.azure-dns.net",
      "ns3-01.azure-dns.org",
      "ns4-01.azure-dns.info"
    ],
    "zoneType": "Public"
  },
  "tags": {
    "key1": "value1"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1",
  "etag": "00000000-0000-0000-0000-000000000000",
  "location": "global",
  "name": "zone1",
  "type": "Microsoft.Network/dnsZones",
  "properties": {
    "maxNumberOfRecordSets": 5000,
    "numberOfRecordSets": 2,
    "nameServers": [
      "ns1-01.azure-dns.com",
      "ns2-01.azure-dns.net",
      "ns3-01.azure-dns.org",
      "ns4-01.azure-dns.info"
    ],
    "zoneType": "Public"
  },
  "tags": {
    "key1": "value1"
  }
}

Definitions

Name Description
CloudError

An error response from the service.

CloudErrorBody

An error response from the service.

SubResource

A reference to a another resource

Zone

Describes a DNS zone.

ZoneType

The type of this DNS zone (Public or Private).

CloudError

An error response from the service.

Name Type Description
error

CloudErrorBody

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

CloudErrorBody[]

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.

SubResource

A reference to a another resource

Name Type Description
id

string

Resource Id.

Zone

Describes a DNS zone.

Name Type Default Value Description
etag

string

The etag of the zone.

id

string

Resource ID.

location

string

Resource location.

name

string

Resource name.

properties.maxNumberOfRecordSets

integer

The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.

properties.maxNumberOfRecordsPerRecordSet

integer

The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.

properties.nameServers

string[]

The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored.

properties.numberOfRecordSets

integer

The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.

properties.registrationVirtualNetworks

SubResource[]

A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private.

properties.resolutionVirtualNetworks

SubResource[]

A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private.

properties.zoneType

ZoneType

Public

The type of this DNS zone (Public or Private).

tags

object

Resource tags.

type

string

Resource type.

ZoneType

The type of this DNS zone (Public or Private).

Name Type Description
Private

string

Public

string