3

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:

2015-05-09_Azure_DNS_01

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
Add-AzureAccount
Get-AzureSubscription
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:

2015-05-09_Azure_DNS_02

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

2015-05-09_Azure_DNS_03

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

2015-05-09_Azure_DNS_06

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 '1.2.3.4' |
Set-AzureDnsRecordSet

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

2015-05-09_Azure_DNS_04

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

2015-05-09_Azure_DNS_05

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

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