DEV Community

1suleyman
1suleyman

Posted on

Exercise 05: Create DNS Zones and Configure DNS Settings

Scenario

In this exercise, I was tasked with configuring DNS settings for workloads in my organization to use domain names instead of IP addresses for internal communication. The organization wanted to use a simple, built-in solution without adding a custom DNS setup. I identified that the requirements included:

  • Creating a private DNS zone for the domain contoso.com.
  • Linking the DNS zone to the app-vnet virtual network.
  • Creating a DNS record for the backend subnet to resolve internal resources.

Skilling Tasks

  • ✅ Create and configure a private DNS zone.
  • ✅ Create and configure DNS records.
  • ✅ Configure DNS settings on a virtual network.

Exercise Instructions

Step 1: Create a Private DNS Zone

To begin, I created a private DNS zone in Azure, which would allow me to manage domain names for internal communication within my Azure virtual network without the need for a custom DNS solution.

1️⃣ Navigate to Azure DNS:

  • In the Azure portal, I searched for and selected Private DNS zones.

2️⃣ Create the DNS Zone:

  • I clicked on + Create to create a new private DNS zone. Here's the configuration I used:
Property Value
Subscription My subscription
Resource group RG1
Name private.contoso.com
Region East US
  • After filling out the details, I clicked Review + Create and then Create.

3️⃣ Wait for the DNS Zone Deployment:

  • I waited for the deployment to complete. Once done, I clicked Go to resource to manage the DNS zone.

Step 2: Create a Virtual Network Link to the Private DNS Zone

Once the DNS zone was created, I needed to link it to my virtual network to resolve the DNS records.

1️⃣ Navigate to Virtual Network Links:

  • Inside the private.contoso.com DNS zone, I selected + Virtual network links in the DNS Management blade.

2️⃣ Add the Virtual Network Link:

  • I clicked + Add and configured the following settings:
Property Value
Link name app-vnet-link
Virtual network app-vnet
Enable auto registration Enabled
  • After filling in the details, I clicked Create to establish the link.

3️⃣ Wait for the Deployment:

  • I waited for the virtual network link to deploy, and I refreshed the page if necessary to ensure the deployment was complete.

Step 3: Create a DNS Record Set

After linking the virtual network, I created DNS records that provided information about the DNS zone and the resources within it.

1️⃣ Navigate to Record Sets:

  • In the DNS Management blade of private.contoso.com, I clicked on + Recordsets.

2️⃣ Add a DNS Record Set:

  • I added a new record set for the backend subnet with the following details:
Property Value
Name backend
Type A
TTL 1
IP address 10.1.1.5
  • This record set pointed to a virtual machine in the app-vnet subnet with a private IP of 10.1.1.5. After completing the configuration, I clicked Add.

Key Takeaways

1️⃣ Azure DNS

Azure DNS offers both public and private DNS zones, allowing you to manage and resolve domain names for your resources. Public DNS zones manage external traffic, while private DNS zones handle internal resources, ensuring that your workloads communicate efficiently within the Azure cloud.

2️⃣ Private DNS Zones

Azure Private DNS zones allow you to create custom domain names for internal resources within a virtual network. This helps ensure that your internal applications communicate using meaningful domain names rather than IP addresses.

3️⃣ Virtual Network Link

By linking a private DNS zone to a virtual network, resources within that network can resolve DNS records for other resources. This integration simplifies the management of DNS resolution for virtual machines and other Azure resources within the network.

4️⃣ DNS Record Sets

DNS records are used to resolve domain names to IP addresses, ensuring that internal resources can be identified and accessed correctly. In this exercise, I created an A record to associate the backend subnet with a specific virtual machine’s IP address.


Conclusion

In this exercise, I successfully created and configured a private DNS zone in Azure. By linking the DNS zone to my virtual network and adding DNS records, I enabled internal resources to communicate using domain names. This solution removed the need for a custom DNS server, leveraging Azure’s built-in DNS services for both simplicity and security.

🚀 Stay tuned for more updates on my Azure journey as I continue to deepen my understanding and skills!

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay