Public DNS Zones
A DNS zone holds the DNS records for a domain. Azure DNS hosts your public DNS zones — managing records for your domain (like contoso.com). Azure DNS uses a global anycast network, providing high availability and fast name resolution from anywhere.
Delegating to Azure DNS
- Create a DNS zone in Azure for your domain (e.g., contoso.com)
- Azure assigns 4 nameservers (e.g., ns1-01.azure-dns.com)
- Log in to your domain registrar and change the NS records to point to these 4 Azure DNS nameservers
- All DNS lookups for contoso.com now resolve via Azure DNS
DNS Record Types
| Record Type | Purpose | Example |
|---|---|---|
| A | Maps hostname to IPv4 address | www → 1.2.3.4 |
| AAAA | Maps hostname to IPv6 address | www → 2001:db8::1 |
| CNAME | Alias — maps hostname to another hostname | blog → mysite.azurewebsites.net |
| MX | Mail exchange — routes email | @ → mail.contoso.com (priority 10) |
| TXT | Text record — domain verification, SPF | @ → "v=spf1 include:..." |
| NS | Nameserver records (auto-created) | @ → ns1-01.azure-dns.com |
| SOA | Start of Authority (auto-created) | Zone metadata |
| PTR | Reverse DNS — maps IP to hostname | 4.3.2.1.in-addr.arpa → www.contoso.com |
| SRV | Service location record | _sip._tcp → sip.contoso.com:5061 |
Alias Records
Azure DNS Alias records are an extension of standard DNS records. They allow an A, AAAA, or CNAME record to directly reference an Azure resource — and automatically update when the resource's IP changes.
| Target Resource | Use Case |
|---|---|
| Azure Public IP address | Point root domain to a dynamic public IP |
| Azure Traffic Manager profile | Point root domain to Traffic Manager |
| Azure Front Door profile | Point root domain to Front Door |
| Azure CDN endpoint | Point root domain to CDN |
Private DNS Zones
Private DNS Zones enable name resolution for resources within Azure VNets — using your own domain names (like internal.contoso.com) that are only resolvable from within the VNet.
Key Differences from Public Zones
| Public DNS Zone | Private DNS Zone | |
|---|---|---|
| Resolvable from | The entire internet | Only linked VNets |
| Use case | Public websites and services | Internal VM communication |
| Auto-registration | No | Yes — auto-registers VMs |
| Linked to | Nothing (global) | Specific VNets |
Auto-Registration of VMs
When you link a Private DNS Zone to a VNet with auto-registration enabled, Azure automatically creates DNS A records for all VMs in that VNet. When a VM is created, its hostname is registered. When deleted, the record is removed. VMs can then resolve each other by name (e.g., vm1.internal.contoso.com).
DNS Resolution in VNets
Three options for DNS in Azure VNets:
- Azure-provided DNS (168.63.129.16) — Default. Resolves Azure internal names and internet names. No configuration needed.
- Azure Private DNS Zones — Custom domain names within VNets. Link zones to VNets for resolution.
- Custom DNS servers — Your own DNS servers (on-premises AD, custom resolvers). Configure at VNet level.
Creating Zones and Records
# Create a public DNS zone
az network dns zone create \
--resource-group myRG \
--name contoso.com
# Create an A record
az network dns record-set a add-record \
--resource-group myRG \
--zone-name contoso.com \
--record-set-name www \
--ipv4-address 1.2.3.4
# Create a CNAME record
az network dns record-set cname set-record \
--resource-group myRG \
--zone-name contoso.com \
--record-set-name blog \
--cname myblog.azurewebsites.net
# Create private DNS zone
az network private-dns zone create \
--resource-group myRG \
--name internal.contoso.com
# Link to VNet with auto-registration
az network private-dns link vnet create \
--resource-group myRG \
--zone-name internal.contoso.com \
--name myVNetLink \
--virtual-network myVNet \
--registration-enabled true