- What an Azure Private DNS zone is and how it differs from network connectivity
- How to create a Private DNS zone in the Azure portal
- How to link virtual networks and enable auto-registration
- How to validate name resolution from Linux VMs (nslookup)
- CLI commands to create a quick test VM
- Enable resolution of hostnames across VNets without exposing records to the public internet
- Centralize private DNS records (e.g.,
*.internal.company.com) for multiple VNets - Integrates with Azure services such as Azure Private Link

- VNet A and VNet B are separate VNets with their own address spaces and internal DNS domains.
- By default, VMs in the same VNet can resolve each other’s hostnames (for example, vm-01 → vm-02).
- To resolve hostnames across VNets (for example, vm-01 → vm-06), create a Private DNS zone (for example,
kodekloud-int.com) and add virtual network links to that zone. - Virtual network links make a VNet aware of a Private DNS zone. Optionally enable auto-registration so Azure automatically creates A records for VMs in the linked VNet.
- Important: Private DNS zones only provide DNS name resolution — they do not provide network connectivity. To enable traffic flow between VNets, configure VNet peering or VPN/gateway connectivity.
Private DNS zones enable private name resolution across VNets when linked, but they do not change network connectivity. Use VNet peering or VPN/gateways to enable traffic between VNets. Auto-registration only works when VMs use Azure DNS and have the VM agent/network settings that allow registration.
Portal: create a Private DNS zone
Steps (brief)- In the Azure portal, search for Private DNS zones and click Create.
- Enter the DNS zone name (e.g.,
kodekloud-int.com) and select a subscription and resource group. - Create the zone. Note that Private DNS zones are global resources — you do not choose a region.

Reusing existing VMs for the demo
For the demo we use existing Linux workload VMs. The Virtual Machines blade lets you view VM names, sizes, and public/private IP addresses.
Inspect the Linux VM DNS configuration and test resolution
- SSH to a workload VM and inspect resolver configuration (Ubuntu often uses systemd-resolved with a local stub resolver at
127.0.0.53).
Create a temporary VM for testing (Azure CLI)
If you need a VM in a separate resource group/VNet for the demo, use the Azure CLI. Example commands and trimmed responses: Set subscription and create a resource group:Create virtual network links for the Private DNS zone
A virtual network link associates a VNet with a Private DNS zone. Links are created per VNet — not per VM — and you can enable auto-registration to populate A records automatically. Portal steps- Open the Private DNS zone (e.g.,
kodekloud-int.com). - Click Virtual network links → Add.
- Provide a link name, select the VNet to link, and enable Auto registration if desired.
- Repeat for each VNet to be able to resolve names in the zone.
Notes
- The link name is for administration only.
- Auto-registration creates A records for VMs in the linked VNet. If auto-registration is disabled, create A records manually or configure DNS forwarding.
Validate cross-VNet resolution
Before linking (failure):- Verify the Private DNS zone shows the expected A records (Private DNS zone → Overview / Records).
- Confirm VNets are linked and show a successful link status in the Private DNS zone blade.
- Ensure VMs use Azure DNS or configure DNS forwarding to Azure.
- Remember: DNS resolution succeeds only if the zone/records exist and the querying VM can reach the DNS service (network connectivity still required separately).
Quick reference: Private DNS zone vs network connectivity
Recap
- Private DNS zones enable private DNS resolution across VNets when you create virtual network links.
- Enable auto-registration to automatically populate A records for eligible VMs (Azure DNS + VM agent).
- Private DNS zones do not create network links — use VNet peering or VPN/gateway solutions to enable traffic.
- Common usage includes service isolation, internal-only hostnames, and Azure Private Link integrations.
Links and references
- Azure Private DNS overview
- Virtual network peering overview
- Azure VPN Gateway overview
- Azure Private Link overview