Specifying a DNS Server in a Virtual Network Configuration File
Updated: December 4, 2014
The Network Configuration file has multiple elements that contain DNS setting values. When these values are specified, all of the roles and virtual machines that are deployed to this virtual network will receive and use these values. Because of this, you won’t need to configure DNS server settings for each item that you deploy to the virtual network after the DNS setting values are specified. For information about how to configure the Virtual Network Configuration file, see Configure a Virtual Network Using Network Configuration Files. For information about each element contained in the Network Configuration file, see Azure Virtual Network Configuration Schema.
|If you used the Management Portal or a Network Configuration file to create your virtual network and you want to edit the DNS settings that you specified, after you make the changes to the virtual network, you must then restart each virtual machine. Restarting the VM allows it to register the new DNS settings. If you don’t restart your VMs, they will continue to use the DNS server settings that were in effect before you made the changes.|
The following listed elements are contained in the Network Configuration file. The title of each element is linked to a page that provides additional information about the element value settings.
<Dns> <DnsServers> <DnsServer name="ID1" IPAddress="IPAddress1" /> <DnsServer name="ID2" IPAddress="IPAddress2" /> <DnsServer name="ID3" IPAddress="IPAddress3" /> </DnsServers> </Dns>
<DnsServersRef> <DnsServerRef name="ID1" /> <DnsServerRef name="ID2" /> <DnsServerRef name="ID3" /> </DnsServersRef>
|In order to specify this setting for the Virtual Network Sites element, it must be previously defined in the DNS element. The DnsServerRef name in the Virtual Network Sites element must refer to a name value specified in the DNS element for DnsServer name.|