Share via


Specifying DNS settings in a virtual network configuration file

Important

Classic Virtual Network is now deprecated for new customers and will be retired on August 31st, 2024 for all customers. New deployments should use the new Azure Resource Manager based deployment model Azure Resource Manager based Virtual Network

A network configuration file has two elements that you can use to specify Domain Name System (DNS) settings: DnsServers and DnsServerRef. You can add a list of DNS servers by specifying their IP addresses and reference names to the DnsServers element. You can then use a DnsServerRef element to specify which DNS server entries from the DnsServers element are used for different network sites within your virtual network.

Important

Before you work with Azure resources, it's important to understand that Azure currently has two deployment models: Azure Resource Manager and classic. Make sure you understand deployment models and tools before you work with any Azure resource. You can view the documentation for different tools by clicking the tabs at the top of this article.

This article covers the classic deployment model.

The network configuration file may contain the following elements. The title of each element is linked to a page that provides additional information about the element value settings.

Important

For information about how to configure the network configuration file, see Configure a Virtual Network Using a Network Configuration File. For information about each element contained in the network configuration file, see Azure Virtual Network Configuration Schema.

Dns Element

<Dns>
  <DnsServers>
    <DnsServer name="ID1" IPAddress="IPAddress1" />
    <DnsServer name="ID2" IPAddress="IPAddress2" />
    <DnsServer name="ID3" IPAddress="IPAddress3" />
  </DnsServers>
</Dns>

Warning

The name attribute in the DnsServer element is used only as a reference for the DnsServerRef element. It does not represent the host name for the DNS server. Each DnsServer attribute value must be unique across the entire Microsoft Azure subscription

Virtual Network Sites Element

<DnsServersRef>
  <DnsServerRef name="ID1" />
  <DnsServerRef name="ID2" />
  <DnsServerRef name="ID3" />
</DnsServersRef>

Note

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.

Next steps