Manage your public DNS zones with Azure DNS

On May 4 2015, Microsoft has released a public preview of a new Microsoft Azure feature – Azure DNS.

Azure DNS is a hosting service for DNS domains, providing name resolution using Microsoft Azure infrastructure. By hosting your domains in Azure, you can manage your DNS records using the same credentials, APIs, tools and billing as your other Azure services.

You can find more information in the Azure DNS documentation.

The service is based on Azure Resource Manager (ARM), and can be managed using the Azure PowerShell module. The DNS cmdlets available in the module are added in the 0.9.1 release, which you can download from the Azure PowerShell repository on GitHub.

You can verify what version you have installed by using Get-Module –ListAvailable –Name Azure:


The mode for the module must be switched to AzureResourceManager, and you must add your account and select your subscription as you normally do when working with the Azure PowerShell module:

Switch-AzureMode -Name AzureResourceManager
Select-AzureSubscription -SubscriptionName "your subscription name"

It’s not currently possible to sign up for the DNS Service preview from the Azure portals, but this can be accomplished by using cmdlets in the Azure PowerShell module.

Register-AzureProvider -ProviderNamespace Microsoft.Network -Force
Register-AzureProviderFeature -ProviderNamespace Microsoft.Network -FeatureName azurednspreview -Force
Get-AzureProviderFeature -ProviderNamespace Microsoft.Network -FeatureName azurednspreview

It may take up to 24 hours for the registration state to change to Registered:


Before creating a new DNS zone, you must decide what resource group to place the zone into. You may use an existing resource group, or you can create a new one:

New-AzureResourceGroup -Name Networking -Location 'West Europe'

For testing purposes, I’ve decided to use a subdomain of my powershell.no domain:

New-AzureDnsZone -Name azure.powershell.no -ResourceGroupName Networking

When the zone is created, you must add the appropriate Name Server (NS) records to the DNS zone at your registrar/hoster (it`s not yet available to host your domain in Azure). To find the values for the records you need to configure, you can use the Get-AzureDnsRecordSet cmdlet:

Get-AzureDnsRecordSet -ZoneName azure.powershell.no -ResourceGroupName Networking -RecordType NS


In the DNS Control Panel at my registrar, it looks like this after I added the NS records for the Azure DNS Service:


Now you can start creating DNS records in the new zone, and they should be resolved by the Azure DNS service.

New-AzureDnsRecordSet -Name www -RecordType A -ZoneName azure.powershell.no -Ttl 60 |
Add-AzureDnsRecordConfig -Ipv4Address '' |

You can then verify the new record by using familiar tools such as the Resolve-DnsName cmdlet or the traditional nslookup utility:


To further explore the available cmdlets for managing Azure DNS, you can use Get-Command -Module AzureResourceManager -Name Dns


You can also find more information and examples on the Azure DNS Documentation website.

Filed in: Articles, Azure Tags: 

3 Responses to "Manage your public DNS zones with Azure DNS"

  1. Shafeeq says:

    We have a subscription with Azure and we are using most of the services provided by Azure. Now we are trying to use the azurednspreview feature for managing our public DNS using Microsoft azure infrastructure.

    We have used following two commands to register with the dns service.

    Register-AzureProvider -ProviderNamespace Microsoft.Network -Force
    Register-AzureProviderFeature -ProviderNamespace Microsoft.Network -FeatureName azurednspreview -Force

    After registering for the service, we tried to see the status using below command.

    Get-AzureProviderFeature -ProviderNamespace Microsoft.Network -FeatureName azurednspreview

    As per the blog, the time for completing the registration is 24 hours and after that there will be a status as “Registered”.

    We made the request yesterday and 24 hours is finished, but still showing status as “Pending”.

    Could you please me the reason for this?

    Thanks in advance.

Leave a Reply

Submit Comment

© 2018 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: