Lesson 2 of 4 Name Resolution and Load Balancing in Azure

Resolving Names Inside Virtual Networks with Private DNS Zones

This lesson explains private DNS zones, virtual network links, auto-registration and hybrid resolution.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe virtual network links and auto-registration.
  • Distinguish between registration and resolution links.
  • Describe how on-premises clients resolve private zones.

Private zones and virtual network links

A private DNS zone, such as corp.contoso.com or privatelink.blob.core.windows.net, is a global resource whose records are resolvable only from virtual networks that have a virtual network link to it. A zone can be linked to many VNets in any region and subscription, and a VNet can be linked to many zones; this is how VNets share name resolution across a hub-and-spoke topology without custom DNS servers. Resolution uses Azure-provided DNS (168.63.129.16), so VNets with custom DNS servers need those servers to forward to Azure DNS.

True or false

Private zones and links

Exam skills 4.3.1

Check how private DNS zones are resolved from virtual networks.

Log in to try this activity Interactive activities are free with an account.

Auto-registration

A virtual network link can enable auto-registration. Azure then creates an A record for every VM in the VNet (named after the VM's host name) and removes it when the VM is deleted, and updates it when the private IP changes. A VNet can have auto-registration enabled for only one private zone, although it can be linked for resolution to many zones. Auto-registration applies to VMs (and scale set instances), not to other resource types such as private endpoints, whose records are created by the private DNS zone group.

Registration link
VM records created automaticallyYes
Per VNetOne zone
Name resolutionYes
Choose when Automatic DNS records for VMs in a VNet
Resolution-only link
VM records created automaticallyNo
Per VNetMany zones
Name resolutionYes
Choose when Resolve names from shared zones

The following diagram shows a private DNS zone and its two virtual network links for name resolution across two peered virtual networks.

Name resolution across two peered VNets in the domain apps.internal. A private DNS zone with virtual network links for VNet1 and VNet2, both with auto-registration enabled, creates each VM's record automatically and resolves it from both VNets. Peering alone does not share resolution for a custom domain.
The scenario is illustrative.
Sort into groups

Who creates the record?

Exam skills 4.3.1

A VNet has a registration link to corp.contoso.com. Decide how each record appears.

Log in to try this activity Interactive activities are free with an account.

Hybrid name resolution

On-premises clients cannot query 168.63.129.16 directly. Azure DNS Private Resolver provides an inbound endpoint (a private IP in a dedicated subnet) to which on-premises DNS servers forward queries for private zones, and an outbound endpoint with forwarding rulesets that send queries for on-premises domains from Azure to on-premises DNS servers. The older alternative is a pair of DNS server VMs in Azure that forward to Azure DNS.

Scenario questions

Resolving names across networks

Exam skills 4.3.1

Choose the component for each hybrid name resolution requirement.

Log in to try this activity Interactive activities are free with an account.
Worked example

Names across two VNets

VNet1 and VNet2 are peered. VMs in both must resolve each other by name in the domain apps.internal, and records must be created automatically when VMs are deployed. Neither VNet has custom DNS servers. What should you configure?

Create the private DNS zone apps.internal and add virtual network links for VNet1 and VNet2, both with auto-registration enabled. Each VM's record is then created automatically and resolvable from both VNets. Peering alone does not share name resolution for a custom domain, and a public DNS zone would expose private addresses on the internet.

Check yourself

With how many private DNS zones can a VNet have auto-registration enabled?

Show answer

One, although it can be linked to many zones for resolution.

Exam Tips

Remember for the exam

  • Private zones resolve only from VNets linked to them.
  • Auto-registration creates VM records; one registration zone per VNet.
  • On-premises resolution of private zones: Azure DNS Private Resolver inbound endpoint.
  • Custom DNS servers must forward to 168.63.129.16 to use private zones.