Support Library
Troubleshooting DNS on Azure DNS
Fix the common DNS problems on Azure DNS: delegation that points at the wrong name servers or loops back on itself, subdomain delegation, apex alias records, Azure Private DNS zones that a virtual network cannot resolve, DNSSEC, and Microsoft Entra custom domain verification.
The short answer
Azure has two DNS products that fail in different ways. Azure Public DNS hosts internet-facing zones on four Azure name servers per zone, so most of its problems are delegation: the parent pointing at the wrong four servers, or a delegation that points back on itself. Azure Private DNS answers only inside virtual networks (VNets) linked to a zone, so most of its problems are a missing link, a custom DNS server that bypasses Azure, or a private zone hiding a public name. Match the symptom first:
| Symptom | Usually means | Section |
|---|---|---|
| Records are right in the portal but the domain does not resolve | The registrar lists different name servers from the zone, often a duplicate or recreated zone | Delegation |
| SERVFAIL or timeouts for a subdomain only | The subdomain's NS record points back at the parent's own servers, or at a deleted child zone | Loops |
| Records for a subdomain are ignored | They sit in the parent zone after the subdomain was delegated to a child zone | Subdomains |
| Cannot create a CNAME at @ | CNAME is not allowed at the apex; use an alias record set | Alias records |
| A private name resolves in one VNet but not another | The second VNet is not linked to the Private DNS zone, or it uses a custom DNS server | Private DNS zones |
| A public name returns NXDOMAIN from a VM | A linked Private DNS zone with that name is authoritative and lacks the record | Private DNS zones |
| Queries through Azure DNS Private Resolver hang or fail | A forwarding ruleset sends queries back to the VNet they came from | Loops |
| SERVFAIL after enabling or removing DNSSEC | The DS record at the registrar does not match the zone | DNSSEC |
| Microsoft Entra cannot verify the domain | The TXT record is in a zone that is not authoritative, or the domain is verified in another tenant | Entra domains |
Step 1: delegate the domain to the zone's own four name servers
Each Azure Public DNS zone is assigned four name servers, one in each of azure-dns.com, azure-dns.net, azure-dns.org and azure-dns.info, for example ns1-37.azure-dns.com. through ns4-37.azure-dns.info.. You cannot choose them, and the domain only works when the registrar publishes all four. Find them on the zone's Overview page, or with the commands below. The usual ways this goes wrong:
- Two zones with the same name. Azure lets you create a zone with the same name in another resource group or subscription, and each copy gets different name servers. Only the copy the registrar points at is live; edits to the other change nothing.
- The zone was deleted and recreated. The new zone is not guaranteed to land on the same name servers, so the registrar may now point at servers that no longer host it. Compare before assuming the records are at fault.
- Only some of the four were entered. Microsoft says to use all four, whatever the domain's own TLD. A name server does not need to share the domain's TLD.
- A missing or doubled trailing dot. Copy each name with its trailing period unless your registrar adds it, otherwise some panels store ns1-37.azure-dns.com.example.com.
- Vanity name servers. Delegating to name servers inside your own zone (such as ns1.example.com) is not supported by Azure DNS.
| Check | Command |
|---|---|
| Every Azure zone with this name, in the current subscription | az network dns zone list --output table |
| One zone's name servers (Azure CLI) | az network dns zone show --resource-group dns-rg --name example.com --query nameServers |
| One zone's name servers (Azure PowerShell) | (Get-AzDnsZone -ResourceGroupName dns-rg -Name example.com).NameServers |
Then check what resolvers on the internet are told, from a network outside Azure:
| Check | macOS or Linux | Windows PowerShell |
|---|---|---|
| Delegation the parent publishes (ask a .com server directly; use your TLD's servers from dig NS com) | dig NS example.com @a.gtld-servers.net +norecurse | Resolve-DnsName example.com -Type NS -Server a.gtld-servers.net -NoRecursion |
| What a recursive resolver returns (may show the zone's own NS records instead of the parent's) | dig NS example.com +short | Resolve-DnsName example.com -Type NS |
| Full path from the root | dig example.com +trace | No built-in trace: query each level yourself with -Server and -NoRecursion, as in the parent row |
| Ask the zone's own server directly | dig @ns1-37.azure-dns.com example.com SOA | Resolve-DnsName example.com -Type SOA -Server ns1-37.azure-dns.com |
A working delegation answers the SOA query with a primary name server such as ns1-37.azure-dns.com and the mailbox azuredns-hostmaster.microsoft.com. Microsoft suggests waiting at least ten minutes after changing the delegation before testing, and a name server change can take up to two days to reach every resolver. If the parent lists servers that do not host the zone, that is a lame delegation.
Step 2: break delegation and forwarding loops
A loop is any setup where a query is sent back to a server that already sent it on. Resolvers stop after a few rounds and return SERVFAIL, or the client times out. In Azure the loop is nearly always one of these:
- A subdomain delegated to the parent's own name servers. If the NS record for dev in example.com lists the parent zone's four servers instead of the child zone's, those servers answer every query for dev.example.com with a referral to themselves. Copy the NS values from the child zone's Overview page, not the parent's.
- A delegation to a zone that no longer exists. Deleting a child zone leaves the NS record in the parent pointing at servers that now refuse the name. Delete the NS record too; a dangling delegation can also let someone else claim the subdomain (see subdomain takeover).
- A Private Resolver ruleset linked to its own VNet. If a DNS forwarding ruleset has a rule whose destination is the resolver's inbound endpoint, linking that ruleset to the VNet where the inbound endpoint lives sends those queries back to the same VNet. Microsoft calls this out as a DNS resolution loop: link the ruleset to spoke VNets only.
- Forwarders pointing at each other. An on-premises server that forwards a zone to the inbound endpoint, while a ruleset forwards the same zone back on premises, bounces queries between the two. Decide which side is authoritative for each zone and forward in one direction only.
| Check | macOS or Linux | Windows PowerShell |
|---|---|---|
| Follow the referrals and look for one that repeats the same name servers | dig dev.example.com +trace | No built-in trace: query each level yourself with -Server and -NoRecursion, in the next row |
| Referral the parent zone gives (should list the child zone's servers, not its own) | dig NS dev.example.com @ns1-37.azure-dns.com +norecurse | Resolve-DnsName dev.example.com -Type NS -Server ns1-37.azure-dns.com -NoRecursion |
Here ns1-37.azure-dns.com stands for one of the parent zone's name servers. For private resolution, query each hop directly, as in Step 5.
Step 3: delegate a subdomain to its own zone
To give engineering.example.com its own zone, open the parent zone and choose + Child zone. Azure creates the child zone and adds an NS record set named engineering to the parent with the child's name servers. You can also create the zone yourself and add that NS record set by hand; both give the same result. Things to check:
- The parent must already be delegated to Azure DNS (or the NS record must be added wherever the parent is hosted, if that is not Azure).
- Move the subdomain's records into the child zone. Once the NS record exists, resolvers follow it, and records for that subdomain left in the parent are never served.
- Add a DS record if the child is signed. When the parent is also an Azure Public DNS zone, add the child's DS record set next to its NS record set in the parent.
| Check | Command |
|---|---|
| The child zone's name servers | Get-AzDnsRecordSet -ZoneName engineering.example.com -ResourceGroupName dns-rg -RecordType NS |
| The delegation in the parent | az network dns record-set ns show --resource-group dns-rg --zone-name example.com --name engineering |
| Resolution end to end | Resolve-DnsName www.engineering.example.com |
Background in delegation and glue records.
Step 4: alias records at the apex
A CNAME cannot sit at the zone apex (see CNAME at the zone apex), and Azure rejects one at @. It also rejects a CNAME on any name that already has another record type. For the apex, Azure DNS offers alias record sets (A, AAAA or CNAME) that point at an Azure resource and follow its address as it changes:
- Azure Front Door and Azure CDN. Front Door does not promise a fixed address, so Microsoft warns against an A record holding its current IP. Use an alias record at @.
- Traffic Manager. An alias record at the apex can point at a Traffic Manager profile. For new setups Microsoft now suggests Traffic Manager Linked Records, which return endpoint addresses directly.
- Public IP addresses. An alias to a public IP resource updates itself when the address changes, and if the resource is deleted the record set becomes empty instead of pointing at an address someone else may receive.
Creating an alias requires the Microsoft.Network resource provider to be registered, in both subscriptions when the zone and the target live in different ones (command below). A target outside Azure cannot be an alias; publish its A and AAAA records, or serve the site on www with a CNAME and redirect the apex.
| Check | Command |
|---|---|
| Register the resource provider | az provider register --namespace Microsoft.Network |
| Apex addresses (macOS or Linux) | dig A example.com +short |
| Apex addresses (Windows PowerShell) | Resolve-DnsName example.com -Type A |
Step 5: Azure Private DNS zones and VNet links
Records in a Private DNS zone are never visible on the internet. They resolve only for clients that query Azure-provided DNS at 168.63.129.16 from a VNet linked to the zone. Work through these in order:
- Is this VNet linked? Open the zone's Virtual network links. Peering does not share links: two peered VNets can reach each other's addresses while names in a zone linked to only one of them fail in the other. Link the zone to every VNet that needs it; the link should show the state Completed.
- Does the VNet use a custom DNS server? Setting custom DNS servers on a VNet overrides the default order, so linked private zones are no longer consulted automatically. Give the custom server a conditional forwarder for the zone that points at 168.63.129.16 (it must run inside a linked VNet, because that address is only reachable from within a VNet), or use Azure DNS Private Resolver. VMs keep their old DNS settings until they restart.
- Is the client on premises? On-premises servers cannot reach 168.63.129.16. Forward the zone to an Azure DNS Private Resolver inbound endpoint in a VNet linked to the zone.
- Is autoregistration on the right zone? A VNet can have autoregistration enabled on only one Private DNS zone. It registers A records for virtual machines only (primary NIC), not load balancers or other resources, and not PTR records.
- Is a private zone hiding a public name? When a linked Private DNS zone matches the end of a name, it is authoritative for it: a missing record returns NXDOMAIN rather than the public answer. For privatelink.* zones used by private endpoints you can turn on Enable fallback to internet on the VNet link (resolution policy NxDomainRedirect); for any other zone, add the record or remove the link.
- Does a forwarding rule cover the same name? Azure checks resolver policy, then linked private zones, then forwarding rulesets, then public DNS. A linked private zone always beats a ruleset rule for the same namespace, and the rule is silently ignored. Among rules, the longest matching name wins.
- Is the private endpoint in the zone? A private endpoint keeps its privatelink A record current through a private DNS zone group. With no zone group, nothing updates the record when the endpoint changes.
Microsoft's advice is to find which resolver the client uses, then compare answers from each one:
| Check | Windows | Linux |
|---|---|---|
| Which resolver the client uses | Get-DnsClientServerAddress -AddressFamily IPv4 | resolvectl status |
| Answer from Azure-provided DNS | Resolve-DnsName db.example.internal -Server 168.63.129.16 | dig @168.63.129.16 db.example.internal |
| Answer from a Private Resolver inbound endpoint | Resolve-DnsName db.example.internal -Server 10.10.0.4 | dig @10.10.0.4 db.example.internal |
| Answer the internet sees | Resolve-DnsName mystorage.blob.core.windows.net -Server 1.1.1.1 | dig @1.1.1.1 mystorage.blob.core.windows.net |
| TCP port 53 reachable. This tests TCP only: a firewall can allow TCP and still drop UDP, so treat the UDP query to 168.63.129.16 above as the real test | Test-NetConnection 168.63.129.16 -Port 53 | dig +tcp @168.63.129.16 example.com |
| Flush the local cache before retesting | Clear-DnsClientCache | sudo resolvectl flush-caches |
| Zones linked to the VNet | az network private-dns link vnet list --resource-group dns-rg --zone-name privatelink.blob.core.windows.net | |
| Private endpoint zone group | az network private-endpoint dns-zone-group list --resource-group app-rg --endpoint-name pe-storage | |
If two answers differ, the record or the zone is the problem; if UDP queries time out (even when the TCP check passes), look at the network path (an NSG that denies the AzurePlatformDNS service tag, Azure Firewall or a network appliance). Flush the client cache before retesting (see the table), and see split-brain DNS for the design side.
Step 6: DNSSEC on Azure Public DNS
Azure Public DNS can sign a zone with DNSSEC using ECDSA P-256 SHA-256 (algorithm 13). Azure rolls the zone signing key automatically; the key signing key normally never changes, and replacing it is a support request that also means updating the DS record. The parent zone must itself be signed, which every major TLD is.
- Signing. Turn on DNSSEC on the zone's DNSSEC page (or with the Azure CLI command in the table below), then publish the DS record it shows at your registrar. If the parent is your own Azure zone, add the DS record set there yourself.
- The portal hides the signing records. DNSKEY, RRSIG and NSEC records are managed by Azure and do not appear in the record list; query them with dig instead.
- Unsigning. Remove the DS record at the registrar first and wait for its TTL to expire. The portal then shows the status Signed but not delegated; only then clear Enable DNSSEC. Unsigning while the DS record is still published makes every validating resolver return SERVFAIL.
- Moving a signed domain. The same rule applies when moving to or from Azure: remove the old provider's DS record and let it expire before changing name servers, then sign on the new side and add the new DS.
| Check | Command |
|---|---|
| Turn on signing (Azure CLI) | az network dns dnssec-config create --resource-group dns-rg --zone-name example.com |
| DS record at the parent | dig DS example.com +short |
| DNSKEY set served by Azure | dig DNSKEY example.com @ns1-37.azure-dns.com +multiline |
| Signing configuration | az network dns dnssec-config show --resource-group dns-rg --zone-name example.com |
| Is validation the cause? (an answer only with +cd means yes) | dig example.com A @1.1.1.1 +cd |
See debugging DNSSEC validation errors and broken vs missing DNSSEC.
Step 7: Microsoft Entra custom domain verification
Adding a custom domain to Microsoft Entra ID asks you to publish a TXT record, a value such as MS=ms12345678 at the apex (@), and then select Verify. When the zone is in Azure DNS:
- Add it to the zone that is actually delegated. A TXT record in a duplicate zone or at the registrar's own DNS panel is invisible if the domain points at another set of name servers. Check it with the commands below.
- Add to the existing TXT record set. Azure keeps all TXT records for a name in one record set, so add the MS= value next to SPF and other values at @ rather than creating a second record set.
- Wait, then check the tenant. Microsoft suggests waiting at least an hour for the record to propagate. If the record is visible everywhere and verification still fails, the domain is probably verified in another Entra tenant: a domain can be verified in only one directory, so remove it there first. Self-service sign-ups (for example Power BI) can create an unmanaged tenant that needs an admin takeover.
| Check | macOS or Linux | Windows PowerShell |
|---|---|---|
| TXT records the internet sees at the apex | dig TXT example.com +short | Resolve-DnsName example.com -Type TXT -Server 1.1.1.1 |
| TXT records on the zone's own server | dig TXT example.com @ns1-37.azure-dns.com +short | Resolve-DnsName example.com -Type TXT -Server ns1-37.azure-dns.com |
Device enrollment and mail records for the same tenant are covered in device enrollment records for Intune and Entra ID and Microsoft 365 email deliverability troubleshooting.
How DNS Panopticon helps
Run Domain Visualizer to see the name servers and records the public sees for the domain, which shows at a glance whether they match the zone's four Azure name servers. Website Recon names the registrar and DNS provider behind a domain. DNSSEC Chain Validator walks the chain from the root and shows where a DS record stops matching, and Security Posture grades DNSSEC, CAA, TLS and mail settings, with each finding linking to the article that explains it.
FAQ
Why does my Azure DNS zone not resolve when the records look correct?
Usually the registrar lists different name servers from the zone. A zone with the same name in another resource group or subscription gets different name servers, and a deleted and recreated zone may land on new ones. Compare the four name servers on the zone Overview page with dig NS output and update the registrar.
Why can one virtual network resolve my Azure Private DNS zone and another cannot?
Only virtual networks linked to the zone can resolve it, and peering does not share links. A virtual network that uses a custom DNS server also skips linked zones unless that server forwards the zone to 168.63.129.16 or to an Azure DNS Private Resolver inbound endpoint.
How do I put my apex domain on Azure Front Door?
Create an alias record set at the zone apex that points at the Front Door endpoint. Do not create an A record with the endpoint address, because Front Door does not promise that the address stays the same.
Why does Microsoft Entra fail to verify my domain when the TXT record exists?
Either the record is in a zone the domain is not delegated to, or the domain is already verified in another Entra tenant. A domain can be verified in only one directory, so remove it from the other tenant or complete an admin takeover of an unmanaged tenant.
Sources and further reading
- Microsoft Learn: Host your domain in Azure DNS: delegation, trailing dots and verification
- Microsoft Learn: Delegation of DNS zones with Azure DNS
- Microsoft Learn: Manage DNS zones with the Azure CLI: zones with the same name get different name servers
- Microsoft Learn: Delegate an Azure DNS subdomain
- Microsoft Learn: Azure DNS alias records overview
- Microsoft Learn: Apex domains in Azure Front Door
- Microsoft Learn: Azure Private DNS zone overview: resolution order with custom DNS servers
- Microsoft Learn: What is a virtual network link?
- Microsoft Learn: Autoregistration in Azure DNS private zones
- Microsoft Learn: Fallback to internet for Azure Private DNS zones
- Microsoft Learn: Azure DNS Private Resolver endpoints and rulesets: including resolution loops
- Microsoft Learn: Troubleshoot Azure DNS
- Microsoft Learn: Troubleshoot NXDOMAIN from an Azure Private DNS zone
- Microsoft Learn: DNSSEC overview
- Microsoft Learn: How to sign your Azure Public DNS zone with DNSSEC
- Microsoft Learn: How to unsign your Azure Public DNS zone
- Microsoft Learn: Add your custom domain name to Microsoft Entra ID: including common verification issues