Introduction
Applications often need to communicate using domain names instead of raw IP addresses. Managing these names securely inside your Azure environment is best done with Azure Private DNS, which eliminates the need for a custom DNS solution. With Private DNS zones, you can define custom domain names (like contoso.com) and resolve them directly within your virtual network.
In this guide, you will learn how to create a private DNS zone, link it to a virtual network, and add DNS records that support internal workload communication.
Skilling Objectives
By completing this walkthrough, you will learn how to:
- Create and configure a private DNS zone.
- Link the DNS zone to a virtual network.
- Add DNS records for internal resources.
Architecture Overview
The solution uses:
- A private DNS zone named
private.contoso.com
. - A virtual network link connecting the DNS zone to app-vnet.
- A DNS record for the backend subnet to allow name-based resolution of workloads.
This setup ensures that workloads inside app-vnet can communicate using domain names, improving readability and maintainability of the environment.
Step 1: Create a Private DNS Zone
You’ll start by creating a private DNS zone.
In the Azure portal, search for Private DNS zones and select + Create.
Select your subscription and resource group (for example, RG1).
Enter the zone name
private.contoso.com
.Choose a region such as East US.
Select Review + create and then Create.
Step 2: Link the DNS Zone to the Virtual Network
Next, link the DNS zone to your app-vnet so that workloads can resolve records from the zone.
- In the portal, open the DNS zone you just created (
private.contoso.com
). - In the DNS management blade, select + Virtual network links.
Provide a link name such as
app-vnet-link
.Select the virtual network
app-vnet
.Enable Auto registration to automatically register virtual machine hostnames.
Step 3: Create a DNS Record Set
Now, add a record for the backend subnet.
- Open the DNS zone
private.contoso.com
. - In the DNS management blade, select + Recordsets.
- Notice that Azure may have already created A records for your virtual machines.
- Select + Add to create a new record set.
- Enter the name
backend
. - Choose record type A.
- Set the TTL to
1
. - Enter the IP address
10.1.1.5
. - Select Add to save the record.
This record means that any workload inside app-vnet can resolve backend.private.contoso.com
to the private IP 10.1.1.5
.
Conclusion
In this walkthrough, you created a private DNS zone in Azure, linked it to your virtual network, and configured a DNS record for the backend subnet. With this setup, workloads can communicate using domain names instead of IP addresses, while relying on Azure’s built-in DNS service.
This approach reduces complexity, improves readability, and provides a secure way to manage internal name resolution without deploying a custom DNS infrastructure.
Top comments (0)