Question

Difficulty: MediumConfigure Azure DNS Private and Public Zones

Your company has a public website hosted externally with the domain name `www.contoso.com` and its DNS records managed in a public Azure DNS zone. You plan to configure split-horizon DNS by deploying an Azure Private DNS zone named `contoso.com` to resolve internal hostnames for virtual machines in a virtual network named `VNet1`. You must ensure that virtual machines in `VNet1` can resolve `www.contoso.com` without service interruption, and that new virtual machines deployed to `VNet1` automatically register their hostnames in the private DNS zone. In which sequence should you perform the configuration steps?

  1. 1Create an Azure Private DNS zone named `contoso.com`.
  2. 2In the private DNS zone, manually create a CNAME record for `www` that points to the public website's external endpoint.
  3. 3Create a Virtual Network link from the private DNS zone to `VNet1` with the auto-registration option enabled.
  4. 4Start the virtual machines in `VNet1` to trigger automatic registration of their hostnames.

Answer

The correct sequence is: first, create the Private DNS zone; second, manually create the public CNAME record in the private zone; third, link the virtual network with auto-registration enabled; and fourth, start the virtual machines to trigger automatic registration.
First, the Private DNS zone must be created. Second, the public CNAME record must be manually added to the private zone before linking to prevent name resolution outages for the public website. When a private DNS zone matches a public namespace, Azure DNS does not forward queries for missing records to the public zone. Third, the Virtual Network link to the target VNet must be established with auto-registration enabled. Finally, the virtual machines must be started so they can register their hostnames automatically upon network initialization.

Step-by-Step Solution

1
Create the Private DNS zone named `contoso.com`.
The private namespace is established in Azure.
This is the prerequisite container for all private records and links.
2
Manually create the CNAME record for the public service `www` in the private DNS zone.
The private DNS zone now contains the pointer to the external endpoint.
This prevents service disruption because Azure DNS will not query public zones for any records under a namespace that has a linked private zone.
3
Create a Virtual Network link from the private DNS zone to `VNet1` and enable auto-registration.
The virtual network is now linked to the private DNS zone.
This enables name resolution within the virtual network and prepares the zone to accept automatic hostname registrations.
4
Start the virtual machines inside `VNet1`.
The virtual machines register their names in the private DNS zone.
The VMs trigger name registration upon startup when the virtual network link is already present.

Key Concept

In a split-horizon DNS deployment, Azure DNS resolves all queries for a namespace using the linked private DNS zone. If a record is not found in the private zone, Azure DNS does not fall back to the public DNS zone. Therefore, public records must be recreated in the private zone before linking it to the virtual network to avoid service disruption.
Rate this question