az network dns zone

Manage DNS zones.

Commands

Name Description Type Status
az network dns zone create

Create a DNS zone.

Core GA
az network dns zone delete

Delete a DNS zone and all associated records.

Core GA
az network dns zone export

Export a DNS zone as a DNS zone file.

Core GA
az network dns zone import

Create a DNS zone using a DNS zone file.

Core GA
az network dns zone list

List DNS zones.

Core GA
az network dns zone show

Get a DNS zone parameters. Does not show DNS records within the zone.

Core GA
az network dns zone update

Update a DNS zone properties. Does not modify DNS records within the zone.

Core GA

az network dns zone create

Create a DNS zone.

az network dns zone create --name
                           --resource-group
                           [--if-none-match]
                           [--parent-name]
                           [--registration-vnets]
                           [--resolution-vnets]
                           [--tags]
                           [--zone-type {Private, Public}]

Examples

Create a DNS zone using a fully qualified domain name.

az network dns zone create -g MyResourceGroup -n www.mysite.com

Create a DNS zone with delegation in the parent within the same subscription and resource group

az network dns zone create -g MyResourceGroup -n books.mysite.com -p mysite.com

Create a DNS zone with delegation in the parent in different subscription

az network dns zone create -g MyResourceGroup -n books.mysite.com -p "/subscriptions/**67e2/resourceGroups/OtherRg/providers/Microsoft.Network/dnszones/mysite.com"

Required Parameters

--name -n

The name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--if-none-match

Only create a DNS zone if one doesn't exist that matches the given name.

default value: False
--parent-name -p

Specify if parent zone exists for this zone and delegation for the child zone in the parent is to be added.

--registration-vnets

Space-separated names or IDs of virtual networks that register hostnames in this DNS zone. Number of private DNS zones with virtual network auto-registration enabled is 1. If you need to increase this limit, please contact Azure Support: https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits.

--resolution-vnets

Space-separated names or IDs of virtual networks that resolve records in this DNS zone.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--zone-type
Deprecated

Argument 'zone_type' has been deprecated and will be removed in a future release.

Type of DNS zone to create.

accepted values: Private, Public
default value: Public
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network dns zone delete

Delete a DNS zone and all associated records.

az network dns zone delete --name
                           --resource-group
                           [--if-match]
                           [--yes]

Examples

Delete a DNS zone using a fully qualified domain name.

az network dns zone delete -g MyResourceGroup -n www.mysite.com

Required Parameters

--name -n

The name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--if-match

Delete only if the resource with the same ETAG exists.

--yes -y

Do not prompt for confirmation.

default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network dns zone export

Export a DNS zone as a DNS zone file.

az network dns zone export --name
                           --resource-group
                           [--file-name]

Examples

Export a DNS zone as a DNS zone file.

az network dns zone export -g MyResourceGroup -n www.mysite.com -f mysite_com_zone.txt

Required Parameters

--name -n

The name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--file-name -f

Path to the DNS zone file to save.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network dns zone import

Create a DNS zone using a DNS zone file.

az network dns zone import --file-name
                           --name
                           --resource-group

Examples

Import a local zone file into a DNS zone resource.

az network dns zone import -g MyResourceGroup -n MyZone -f /path/to/zone/file

Required Parameters

--file-name -f

Path to the DNS zone file to import.

--name -n

The name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network dns zone list

List DNS zones.

az network dns zone list [--resource-group]

Examples

List DNS zones in a resource group.

az network dns zone list -g MyResourceGroup

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network dns zone show

Get a DNS zone parameters. Does not show DNS records within the zone.

az network dns zone show --name
                         --resource-group

Examples

List DNS zones in a resource group.

az network dns zone show -g MyResourceGroup -n www.mysite.com

Required Parameters

--name -n

The name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network dns zone update

Update a DNS zone properties. Does not modify DNS records within the zone.

az network dns zone update --name
                           --resource-group
                           [--add]
                           [--force-string]
                           [--if-match]
                           [--registration-vnets]
                           [--remove]
                           [--resolution-vnets]
                           [--set]
                           [--tags]
                           [--zone-type {Private, Public}]

Examples

Update a DNS zone properties to change the user-defined value of a previously set tag.

az network dns zone update -g MyResourceGroup -n www.mysite.com --tags CostCenter=Marketing

Update a DNS zone properties (autogenerated)

az network dns zone update --name www.mysite.com --remove tags.no_80 --resource-group MyResourceGroup

Required Parameters

--name -n

The name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

default value: []
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

default value: False
--if-match

Update only if the resource with the same ETAG exists.

--registration-vnets

Space-separated names or IDs of virtual networks that register hostnames in this DNS zone. Number of private DNS zones with virtual network auto-registration enabled is 1. If you need to increase this limit, please contact Azure Support: https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

default value: []
--resolution-vnets

Space-separated names or IDs of virtual networks that resolve records in this DNS zone.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

default value: []
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--zone-type
Deprecated

Argument 'zone_type' has been deprecated and will be removed in a future release.

Type of DNS zone to create.

accepted values: Private, Public
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.