Azure DNS

On Tuesday at Ignite Microsoft announced a number of new Azure services, one of which was Azure DNS. The ability to host your DNS zones has been a feature of cloud providers like AWS for some time now, so it’s good to see Microsoft adding in this essential component for providing web services.

Before venturing into using Azure DNS there are a few things to be aware of, firstly it’s not (yet) available in the management portal, you can use it via PowerShell, .Net SDK or Resource Manger REST API’s. Secondly you have to sign up to the preview before you can use it.

There is a a step by step guide to setting up and using Azure DNS through PowerShell on the MSDN site here so I won’t go into every detail of how to get started with this, however there are a few gotchas I came across.

Registering for Azure DNS

First off, you need to the latest version of the PowerShell cmdlets. If you find you are getting errors when trying to run the “Register-AzureProvider” cmdlet it likely means your not using the Azure PowerShell cmdlets that were released on Monday.

Once you’ve run through the first steps in the guide and got to the point where you register for the preview, you will sit in a pending state for some time before you can use the preview. To find out if your request to use the preview has been approved you can run the following command:

Once your registration changes to “Registered” you then need to run the command to register the provider again, otherwise you will see an erro.

Register-AzureProvider -ProviderNamespace Microsoft.Network

Creating Zones and Records

Once your registered you can go ahead and create a zone with a single PowerShell command

New-AzureDnsZone -Name samcogan.com -ResourceGroupName ResourceGroup1

At this point you have an empty zone, which you need to add records to.

However, to add a record you first need to create a Record Set. A record set contains the name and type of the record you want to create, but does not directly have an IP address. IP addresses are added as records to a record set. In this way you can have multiple IP’s per record.