Today Microsoft made the Azure DNS service available for public preview. It’s been tested thoroughly in private preview the last couple of months but finally it’s available for everyone and we can start testing it even more.
Azure DNS support the following records:
- A
- AAAA
- CNAME
- MX
- NS
- SOA
- SRV
- TXT
How do you get access, you say? Well, normally when requesting access to Azure preview features we just go to http://azure.microsoft.com/en-us/services/preview/,click “Try now” and wait for approval. Not this time though, we have to use… PowerShell!
First we have to switch mode to Azure Resource Manager:
[powershell]Switch-AzureMode -Name AzureResourceManager[/powershell]
If you haven’t already done so, make sure to add your Azure account and select it:
[powershell]Add-AzureAccount
Select-AzureSubscription -SubscriptionName "SubscriptionName"[/powershell]
If you don’t have a resource group, create one:
[powershell]New-AzureResourceGroup -Name CloudPuzzlesRG -location "North Europe"[/powershell]
After this we will be able to request access:
[powershell]Register-AzureProviderFeature -ProviderNamespace Microsoft.Network -FeatureName azurednspreview[/powershell]
Using the Get equivalent we can check the status of this request:
[powershell]Get-AzureProviderFeature -ProviderNamespace Microsoft.Network -FeatureName azurednspreview[/powershell]
Creating a DNZ zone is done with the New-AzureDNSZone cmdlet, and we can then see what name servers has been assigned for the zone by using Get-AzureDnsRecordSet:
[powershell]$zone = New-AzureDnsZone -Name cloudpuzzles.net -ResourceGroupName CloudPuzzlesRG
Get-AzureDnsRecordSet –Name “@” –RecordType NS –Zone $zone[/powershell]
The Get-AzureDnsRecordSet will return a list of name servers, for example: ns1-04.azure-dns.com, ns2-04.azure-dns.net, ns3-04.azure-dns.org, ns4-04.azure-dns.info
We can then change the name servers at our domain registrar.
When we have done that we can start creating DNS entries. This is done by using “record sets” which contains all the IP adresses for that record – so you can have multiple IP for the same record.
[powershell]$recordset = New-AzureDnsRecordSet -Name "www" -RecordType "A" -ZoneName "cloudpuzzles.net" -ResourceGroupName "CloudPuzzlesRG" -Ttl 60
Add-AzureDnsRecordConfig -RecordSet $recordset -Ipv4Address 94.245.104.73
Add-AzureDnsRecordConfig -RecordSet $recordset -Ipv4Address 94.245.104.74[/powershell]
When we do this we update the local $recordset variable, nothing is changed in Azure until we commit the changes:
[powershell]Set-AzureDnsRecordSet -RecordSet $recordset[/powershell]
We can then see the records created:
[powershell]Get-AzureDnsRecordSet –Name www –RecordType A -ZoneName cloudpuzzles.net -ResourceGroupName CloudPuzzlesRG[/powershell]
That’s it for now, more will follow as information is made public.
Hey Jesper,
Great article. Clear, to the point, and plenty to copy and paste into PowerShell easily. Keep up the good work.
Has there been any indication of when this product is going to move to GA? I can see it would be great but don’t want to move production domains to it until it is out of preview.
Also there is a typo in there – Creating a DNZ zone. Just figured you’d want to know.
Regards,
GM.
LikeLike
Hey,
Glad you liked it!
I haven’t heard anything about GA yet. Could be Q4, could be tomorrow, never really know with Azure, everything moves so fast. My guess is it won’t be long, but there are some things that needs to be fixed first.
Oh, and thanks, will correct it.
-Jesper
LikeLike