How can I use Azure-provided DNS for Resource Manager VMs?

1.8k views Asked by At

I've been migrating my Azure resources from the V1 Service Management API to the V2 Resource Manager API, but am not sure about Azure-provided DNS. Previously I could ping hosts within the same Cloud Service, however there are no more Cloud Services in V2. Hosts cannot ping each other within the same Resource Group either.

The only change I have made is adding the hostname to /etc/hosts, so a VM can ping itself (resolving to 127.0.0.1):

127.0.0.1 localhost
127.0.0.1 myazurevmhostname

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

The resolv.conf file is left as the default:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.0.2.2
nameserver 10.0.2.3
search reddog.microsoft.com

So if I had the VMs myvm1 and myvm2, I am expecting to be able to nslookup myvm2 from myvm1, however this does not work. So how can I create a 'cloud only' network with Resource Manager, without having to provide my own DNS server?

Update Since I asked this question originally, Microsoft have made changes on the backend to allow internal name resolution without a DNS server.

2

There are 2 answers

1
JerodG On BEST ANSWER

For the Resource Manager API most things are centered around a resource group.

e.g.

  • myazurevmresourcegroupname
    • myazurevirutalnetworkname
      • myazurevmhostname
      • myazurevmhostname2

Deployment Model: Resource group

Associate: VM's w/ virtual network & resource group

For Internal Name Resolution(Private IP): - Create a Resource Group - Create a virtual network (associate w/ resource group) - Configure ip range and subnets - Create virtual machine(s) (associate w/ resource group & virtual network)

For External Name Resolution(Public IP): In the new azure management portal:

  • Go to the virtual machine in question
  • Click on the public ip address
  • In the settings pane click on Configuration
  • Change DNS name label

It's not as nice of an address as the cloud services (vmname.cloudapp.net)

You end up with: yourdnslabel.locationname.cloudapp.azure.com

e.g. yourwebsrv.eastus.cloudapp.azure.com

4
jangelfdez On

You can add a new resource from the Microsoft.Network resource provider. If you are using ARM templates, the schema can be found in this MSDN Article:

If you are using PowerShell, the reference of the Network cmdlets for Azure Resource Manager is in this another MSDN Article: