Home › Studies › AZ-104 › Virtual Networking › Azure DNS

Azure DNS

Public zones · delegation · record sets · alias records · private zones · RBAC and locks

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Public zones and delegation

Record sets

Alias record sets

Private DNS zones

RBAC and locks

ToolWhat it does
DNS Zone ContributorManages public DNS resources (Microsoft.Network/DNSZones). It doesn't grant permissions to private DNS zones. On a resource group it gives full control of the zones there without letting the user create or stop VMs
Private DNS Zone ContributorManages private DNS resources (Microsoft.Network/privateDnsZones)
Custom roleFiner control, for example CNAME-only (Microsoft.Network/dnsZones/CNAME/* plus Microsoft.Network/dnsZones/read). Create with az role definition create or New-AzRoleDefinition -InputFile, not in the portal. A role that blocks record set deletion but allows update isn't an effective control: records can be removed from the set
ReadOnly lockOn a zone: no new record sets, and no changes or deletes to existing ones. Locks apply to every user and role
CanNotDelete lockOn a record set it isn't an effective control (records can still be removed). To block deleting the zone, put CanNotDelete on the SOA record set (<zone>/@); other record sets can still change. Record-set locks can only be created with Azure PowerShell

Both roles can be assigned at subscription, resource group, zone or record set scope. Deleting a zone deletes all its record sets and can't be undone.

CLI and PowerShell

TaskCommand
Create a public zoneaz network dns zone create -g MyResourceGroup -n contoso.xyz
Add an A recordaz network dns record-set a add-record -g MyResourceGroup -z contoso.xyz -n www -a 10.10.10.10
List recordsaz network dns record-set list -g MyResourceGroup -z contoso.xyz
Show name serversaz network dns record-set ns show --resource-group MyResourceGroup --zone-name contoso.xyz --name @
Test before delegationnslookup www.contoso.xyz <azure name server>
Create a private zoneaz network private-dns zone create -g test-rg --name "privatelink.azurewebsites.net"
Link a vnet (true for autoregistration)az network private-dns link vnet create -g rg --zone-name <zone> --name dns-link --virtual-network vnet-1 --registration-enabled false
Assign DNS Zone Contributoraz role assignment create --assignee "<user>" --role "DNS Zone Contributor" --resource-group "<rg>"
PowerShell A record set$Records = @(); $Records += New-AzDnsRecordConfig -IPv4Address 1.2.3.4; New-AzDnsRecordSet -Name "www" -RecordType A -ResourceGroupName "MyResourceGroup" -TTL 3600 -ZoneName "myzone.com" -DnsRecords $Records
PowerShell alias record setNew-AzDnsRecordSet ... -TargetResourceId <resource ID>. for a Traffic Manager linked record set use -TrafficManagerProfileId instead

With New-AzDnsRecordSet, an existing record set with the same name and type needs -Overwrite. SOA records are created automatically and can't be created manually.

Limits

ItemValue
Public DNS zones per subscription250
Record sets per public zone10,000
Records per record set (public)20
TXT records per record set (public)400
Private DNS zones per subscription1,000
Record sets per private zone25,000
Vnet links per private zone1,000 (100 with autoregistration)
Name servers per delegated zone4

Exam Tips

Tick each tip once you can answer it without looking.

“Host contoso.com in Azure DNS so the internet resolves it” → Create the zone, then set the registrar's NS records to the Azure name servers. Trap: creating only the A records.

“How many Azure name servers to set at the registrar” → All four assigned to the zone. Trap: any one of them.

“Verify delegation” → nslookup -type=SOA <domain> (allow 10 minutes or more). Trap: pinging the zone.

“Buy a domain in Azure DNS” → Not supported: use App Service domains or a registrar. Trap: a Register option in Azure DNS.

“CNAME for contoso.com (the apex) to a Traffic Manager profile” → An alias A or AAAA record set. Trap: a CNAME at @ is not allowed.

“CNAME www and A www in the same zone” → Not allowed: a CNAME cannot coexist with another record set of that name. Trap: assuming both can exist.

“Prevent a dangling DNS record when a public IP is deleted or changes” → An alias record set that points to the public IP resource. Trap: an A record with a low TTL.

“Alias record target public IP SKU” → Standard. Trap: Basic.

“Record types an alias record set can use” → A, AAAA and CNAME. Trap: MX or TXT.

“Alias record creation fails” → Register the Microsoft.Network resource provider (both subscriptions if different). Trap: missing Contributor on the DNS zone.

“SPF record” → Create it as a TXT record. Trap: the SPF type is not supported.

“Delete the zone's apex NS record set” → Not possible: it is removed only with the zone. Trap: deleting and recreating it.

“Same zone name in two resource groups” → Allowed, but each gets different name servers; only one set goes to the registrar. Trap: being blocked.

“VMs in a vnet should auto-register hostnames in contoso.internal” → A private DNS zone plus a vnet link with autoregistration enabled. Trap: a public zone.

“A vnet needs autoregistration into two private zones” → Not allowed: one autoregistration zone per vnet. Trap: peering does not change that.

“Two vnets in different regions resolve the same private zone” → Link both vnets to the zone; no peering needed. Trap: peering is not required.

“Resolve private zone records from on-premises” → Azure DNS Private Resolver with conditional forwarding. Trap: a VPN alone.

“Admin must manage public DNS zones in a resource group but not VMs” → DNS Zone Contributor on the resource group. Trap: it does not cover private zones: use Private DNS Zone Contributor there.

“Freeze a zone so records can't be added, changed or deleted” → ReadOnly lock on the zone. Trap: a CanNotDelete lock on a record set: records can still be removed.

“Stop anyone deleting the zone itself” → CanNotDelete lock on the SOA record set (PowerShell only). Trap: a lock on another record set.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Service & Private EndpointsLoad Balancer →