Azure – Setting up DNS within an Azure Virtual Network

azuredomain-name-systemvirtual-network

I have a few Cloud Services, and a VM running Redis in Azure. From what I understand I need to create a Virtual Network so the cloud services can communicate to Redis on the VM. That was easy. Now what I would like to do is set up DNS so I don't have to specify IP Addresses everywhere.

The articles I am finding all deal with integrating an on site DNS server, but I don't have that. Is there anyway to use godaddy, or dnsimple for this? What about just installing a simple DNS service on the current VM?

I guess my question can be summed up as what do I need to do to make it so my cloud services can communicate to my VN via a DNS name?

Best Answer

There are some "hidden" features of VN in Azure that will help you. First of all, yes, you are correct. If you create a Virtual Network, name resolution will not work unless you provide your own DNS Server and set it up to allow dynamic updates. You can't use public DNS Services to provide DNS name resolution for Windows Azure Virtual Network.

So here is your solution. You must start "Clean" because you cannot change DNS Server IP Address once VNet has running Virtual Machines in it.

  • Create the VNet as usual (and its subnets)
  • Provide DNS Server address. Set this address to be xxx.xxx.xxx.4 (4 will always be the first IP Address assigned in a given SubNet!) !
  • On that clean VNet, Create a new VM with Windows Server. That VM will get xxx.xxx.xxx.4 IP Address
  • Install and configure DNS Server Role on this machine
  • DO NOT SET STATIC IP ADDRESS OF THIS MACHINE!
  • Create rest of the VMs as usual

Things to be aware of:

  • Never assign static IP Addresses to any VM in Windows Azure. They must have DHCP allocated IP Addresses
  • Be careful to first create the DNS Machine, so that it get .4 IP Address
  • Your DNS VM will preserve its IP Address (.4) as long as you do not DELETE it.

This architecture has proven to be valid and works within Windows Azure IaaS (a.k.a. Virtual Machines)

Related Topic