Introduction
In modern cloud environments, relying on IP addresses for internal communication is both inefficient and prone to errors. Organizations increasingly prefer using domain names for better readability, scalability, and manageability. Azure offers a built-in solution—Azure Private DNS—that enables secure, internal name resolution without deploying custom DNS servers.
This guide walks you through the process of creating and configuring a Private DNS zone, linking it to a virtual network, and setting up DNS records. Each step is explained not just technically, but also strategically—so you understand the why behind the how.
Scenario Overview
Your organization has the following requirements:
- Internal workloads must use domain names instead of IP addresses.
- No custom DNS solution should be added.
- A Private DNS zone is needed for contoso.com.
- The zone must be linked to the app-vnet virtual network.
- A DNS record is required for the backend subnet.
Skilling Tasks
- Create and configure a Private DNS zone
- Create and configure DNS records
- Configure DNS settings on a virtual network
Step 1: Create a Private DNS Zone
Azure Private DNS provides a reliable, secure DNS service to manage and resolve domain names in a virtual network without the need to add a custom DNS solution. By using private DNS zones, you can use your own custom domain names rather than the Azure-provided names.
- On the Azure portal, search for and select Private DNS zones.
2. Select + Create and configure the DNS zone.
Property Value
Subscription Select your subscription
Resource group RG1
Name private.contoso.com
Region West US 3
3. Select Review + create and then select Create.
4. Wait for the DNS zone to deploy, and then select Go to resource.
Step 2: Link the DNS Zone to a Virtual Network
To resolve DNS records in a private DNS zone, resources must be linked to the private zone. A virtual network link associates the virtual network to the private zone.
- In the portal, continue working on the private.contoso.com DNS zone.
- In the DNS Management blade, select + Virtual network links.
- Select + Add” and configure the virtual network link.
![Addon Virtuallink(https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ir2fa2dznm1cp23xkukl.png)
4. Select Create and wait for the deployment to finish. If necessary, Refresh the page.
Property Value
Link name app-vnet-link
Virtual network app-vnet
Enable auto registration Enabled
Step 3: Create a DNS Record Set
DNS records map domain names to IP addresses. Creating an A record for the backend subnet allows internal services to reach the backend VM using a friendly name like backend.private.contoso.com.
Property Value
Name backend
Type A
TTL 1
IP address 10.1.1.5
Note: This record set implies there is a virtual machine in app-vnet with a private IP address of 10.1.1.5.
Key takeaways
Congratulations on completing the exercise. Here are the main takeaways:
- Azure DNS is a cloud service that allows you to host and manage domain name system (DNS) domains, also known as DNS zones.
- Azure DNS public zones host domain name zone data for records that you intend to be resolved by any host on the internet.
- Azure Private DNS zones allow you to configure a private DNS zone namespace for private Azure resources.
- A DNS zone is a collection of DNS records. DNS records provide information about the domain.
Top comments (0)