The New-AzDnsZone cmdlet creates a new Domain Name System (DNS) zone in the specified
resource group. You must specify a unique DNS zone name for the Name parameter or the cmdlet will
return an error. After the zone is created, use the New-AzDnsRecordSet cmdlet to create record
sets in the zone.
You can use the Confirm parameter and $ConfirmPreference Windows PowerShell variable to control
whether the cmdlet prompts you for confirmation.
This command creates a new Private DNS zone named myprivatezone.com in the specified resource group with
an associated resolution virtual network (specifying its ID), and then stores it in the $Zone variable.
Example 3: Create a Private DNS zone by specifying virtual network objects
This command creates a new Private DNS zone named myprivatezone.com in the specified resource group with
an associated resolution virtual network (referred to by $ResVirtualNetwork variable), and then stores it
in the $Zone variable.
Example 4: Create a DNS zone with delegation by specifying parent zone name
This command creates a new child DNS zone named mychild.zone.com in the specified resource group and stores
in the $Zone variable.
It also adds delegation in the parent DNS zone named zone.com residing in the same subscription and resource group as child zone.
Example 5: Create a DNS zone with delegation by specifying parent zone id
This command creates a new child DNS zone named mychild.zone.com in the specified resource group and stores
in the $Zone variable.
It also adds delegation in the parent DNS zone named zone.com in resource group other-rg provided subscription is same as that of child zone created.
Example 6: Create a DNS zone with delegation by specifying parent zone object
This command creates a new child DNS zone named mychild.zone.com in the specified resource group and stores
in the $Zone variable.
It also adds delegation in the parent DNS zone named zone.com as passed in the ParentZone object
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
The type of the zone, Public or Private. Zones without a type or with a type of Public are made available on the public DNS serving plane for use in the DNS hierarchy. Zones with a type of Private are only visible from with the set of associated virtual networks (this feature is in preview). This property cannot be changed for a zone.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
You can use the Confirm parameter to control whether this cmdlet prompts you for confirmation.
By default, the cmdlet prompts you for confirmation if the $ConfirmPreference Windows PowerShell variable has a value of Medium or lower.
If you specify Confirm or Confirm:$True, this cmdlet prompts you for confirmation before it runs.
If you specify Confirm:$False, the cmdlet does not prompt you for confirmation.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.