Create Azure DNS zones using CLI

Create the resource group

First, create a resource group to contain the DNS zone:

az group create –name MyAzureResourceGroup –location “East Asia”

Create a DNS zone

az network vnet create \
–name myAzureVNet \
–resource-group MyAzureResourceGroup \
–location eastus \
–address-prefix \
–subnet-name backendSubnet \

az network dns zone create -g MyAzureResourceGroup \
-n chirkut.local \
–zone-type Private \
–registration-vnets myAzureVNet

List DNS zones

az network dns zone list \
–resource-group MyAzureResourceGroup

az network dns zone list

Create an additional DNS record

The following example creates a record with the relative name db in the DNS Zone chirkut.local, in resource group MyAzureResourceGroup. The fully qualified name of the record set is db.chirkut.local. The record type is “A”, with IP address “”.

az network dns record-set a add-record \
-g MyAzureResourceGroup \
-z chirkut.local \
-n db \

View DNS records

To list the DNS records in your zone, run:

az network dns record-set list \
-g MyAzureResourceGroup \
-z chirkut.local

Delete all resources

When no longer needed, delete the MyAzureResourceGroup resource group to delete the resources created in this tutorial.

az group delete –name MyAzureResourceGroup

Leave a Reply

Your email address will not be published. Required fields are marked *