AdvancedLesson 7 of 10

DNS and Name Resolution

Reliable networking depends on correct name resolution. Learn Azure DNS zones, private DNS, and hybrid resolution patterns that keep traffic on intended private paths.

What Is It? (Simple Explanation)

DNS translates names to IP addresses so users and applications do not need to remember numeric addresses.

Why Do We Need It?

How It Works (Technical)

DNS TypeScopePrimary Use
Azure Public DNSInternetPublic domain hosting
Azure Private DNSVNet/internalPrivate service resolution
Custom DNS ForwarderHybridOn-prem and Azure integrated resolution

Private DNS and Private Endpoints

For private endpoints, public service names should resolve to private IP addresses in your VNet. This requires private DNS zones and VNet links.

Visual Representation

Private Name Resolution Path
App VM
Query: sql-prod.database.windows.net
Private DNS Zone
privatelink.database.windows.net
A record -> 10.20.3.4
Private Endpoint
Private IP in data subnet

Hands-on Commands

Azure CLI
# Create private DNS zone
az network private-dns zone create -g rg-dns -n privatelink.database.windows.net

# Link zone to VNet
az network private-dns link vnet create -g rg-dns -n link-vnet-prod \
  -z privatelink.database.windows.net -v /subscriptions//resourceGroups/rg-net/providers/Microsoft.Network/virtualNetworks/vnet-prod -e false

# Create A record
az network private-dns record-set a add-record -g rg-dns -z privatelink.database.windows.net \
  -n sql-prod --ipv4-address 10.20.3.4

# Test DNS from VM
nslookup sql-prod.privatelink.database.windows.net

Real-world Use Case

A platform team moves PaaS services behind private endpoints and links private DNS zones to hub and spoke VNets, ensuring database traffic stays on private routes.

Debugging Scenario

Issue: Service resolves to public IP instead of private IP.

Interview Questions

Beginner

What is Azure DNS?

A managed authoritative DNS hosting service for public zones in Azure.

Intermediate

Why use private DNS zones?

To resolve internal names and private endpoint names to private IPs within VNets.

Scenario-based

Hybrid app cannot resolve Azure private endpoint from on-prem.

Set up DNS forwarding from on-prem DNS to Azure DNS forwarder and ensure private zone links and conditional forwarders are configured.

Summary

DNS errors often look like network outages. Proper private DNS design is critical for secure private traffic flow and reliable hybrid architectures.