Networking

Azure DNS Private Resolver: diagnose a forwarding loop before changing zones

A production runbook for proving an Azure DNS Private Resolver forwarding loop, isolating the ruleset link or target that closes it, and validating recovery without rewriting private zones.

13 Oct 2026 azurednsdns-private-resolverhybrid-dnsforwarding-rulesetnetworkingobservabilityautomationrunbookrollbackproduction

An internal name starts returning SERVFAIL or timing out from a hub VNet. The same name works from a spoke, or the failure appears only after a DNS forwarding ruleset link is deployed. Under incident pressure, the obvious fixes are to add a record, relink the private zone, restart a resolver or broaden UDP 53 access. None of them proves where the query went.

The running case is a hub-and-spoke Azure platform with DNS Private Resolver. A ruleset contains a rule that sends a suffix to the resolver’s inbound endpoint so selected spokes can resolve a private zone linked to the hub. The ruleset was also linked to the hub VNet. A query originating in that hub can now be sent back toward the same resolution context until the client receives a timeout or failure.

This runbook turns that topology into evidence, identifies the edge that closes the loop, removes only that edge as a canary, and keeps a configuration rollback ready. A Private Endpoint may be one consumer of the private zone, but it is not the diagnostic model: the failure is in the forwarding graph.

Freeze one DNS question and one change window

Do not begin with every failing hostname. Select one FQDN, one record type and two source networks: a source that fails and a control that still resolves. Capture the resolver configured on each source, the exact error, UTC timestamps and the most recent changes to rules, links, endpoint IPs, custom DNS settings and private zone links.

Preserve answers with TTL and flags before flushing a cache. A cache hit from the control source may explain why it still appears healthy while new queries from the hub enter the loop.

text dns-loop-incident-scope.txt
Question
FQDN: api.corp.example
Type: A
Expected answer: 10.40.8.20

Failing source
VNet and subnet: vnet-hub-prod / snet-ops
Resolver configured by the client
SERVFAIL, timeout or unexpected answer
First and last failure in UTC

Control source
VNet and subnet: vnet-app-prod / snet-app
Resolver configured by the client
Answer, TTL and response time

Recent changes
Forwarding rule target or state
Ruleset VNet link
Inbound endpoint IP
VNet custom DNS configuration
Private DNS zone link

Draw the resolution graph before testing ports

A successful TCP or UDP probe to port 53 only proves reachability. It does not prove that the destination can answer without sending the question back into the same path.

Model each forwarding decision as a directed edge. For a spoke using Azure-provided DNS and a linked ruleset, the path can be spoke -> Azure DNS -> ruleset -> outbound endpoint -> target DNS. For on-premises resolution of an Azure private zone, it can be on-prem DNS -> inbound endpoint -> Azure DNS -> linked private zone. A loop exists when a rule or conditional forwarder points back to a resolver context that will apply the same forwarding decision again.

The critical pattern in this incident is narrower: a forwarding rule targets the Private Resolver inbound endpoint, and the same ruleset is linked to the VNet that contains that inbound endpoint. The hub does not gain a new resolution path; it gains a path back to itself.

Export the control plane without changing it. Names alone are insufficient: retain resource IDs, endpoint IPs, rule state, suffix, target servers and every linked VNet. Compare the result with IaC and the last known good deployment.

bash 01-private-resolver-loop-inventory.sh
RG="rg-network-prod"
RESOLVER="pdnsr-hub-prod"
RULESET="pdnsrs-hub-prod"

az network dns-resolver show --resource-group "$RG" --name "$RESOLVER" --output jsonc

az network dns-resolver inbound-endpoint list --resource-group "$RG" --dns-resolver-name "$RESOLVER" --output jsonc

az network dns-resolver outbound-endpoint list --resource-group "$RG" --dns-resolver-name "$RESOLVER" --output jsonc

az network dns-resolver forwarding-ruleset rule list --resource-group "$RG" --ruleset-name "$RULESET" --output jsonc

az network dns-resolver forwarding-ruleset virtual-network-link list --resource-group "$RG" --ruleset-name "$RULESET" --output jsonc

Build a small table from the snapshot. For each suffix, answer four questions: which VNet can invoke the rule, which outbound endpoint carries it, which server receives it, and what that server does with the same suffix. Highlight an inbound endpoint target that belongs to a linked VNet. Also look for a second loop across on-premises DNS, for example when Azure forwards corp.example on premises and the on-premises conditional forwarder sends the same suffix back to Azure.

Prove the loop by changing the source, not the zone

Run the same query from the failing hub, a linked spoke, an unlinked control network if available, and an on-premises source. Query the normal client resolver first. Then query the inbound endpoint directly from a permitted diagnostic host. Use both UDP and TCP because a large response or fallback can expose a different network failure; consistent failure on both protocols strengthens the topology hypothesis but does not prove it alone.

bash 02-replay-dns-question.sh
FQDN="api.corp.example"
INBOUND_IP="10.10.0.4"

echo "client resolver"
cat /etc/resolv.conf
dig "$FQDN" A +noall +answer +comments +stats

echo "inbound endpoint over UDP"
dig @"$INBOUND_IP" "$FQDN" A +noall +answer +comments +stats

echo "inbound endpoint over TCP"
dig +tcp @"$INBOUND_IP" "$FQDN" A +noall +answer +comments +stats

echo "negative control"
dig @"$INBOUND_IP" does-not-exist.corp.example A +noall +authority +comments +stats

Do not use a public resolver as the healthy control for a private name. It follows a different authority path and can return NXDOMAIN correctly while the private chain is broken.

Interpret the cohorts together:

  • Hub fails after the hub ruleset link appeared, while a spoke retains the expected answer: inspect whether the hub link closes a rule back to its own inbound endpoint.
  • Azure and on-premises both time out for the same suffix: inspect reciprocal conditional forwarding before changing Azure zones.
  • Direct inbound query succeeds, but normal hub resolution fails: the inbound endpoint and private zone path can answer; focus on the rule selection and VNet link applied to the client path.
  • Only TCP or only UDP fails: qualify NSG, UDR, firewall, NVA and MTU behavior before declaring a forwarding loop.
  • The endpoint returns a fast authoritative or recursive negative answer: investigate records and zone visibility; a fast negative is different from repeated forwarding until timeout.

Isolate the edge that closes the loop

The containment must correspond to one proven edge. In the running case, remove the forwarding ruleset link from the hub VNet while leaving links to the intended consumer spokes intact. Do not delete the ruleset, inbound endpoint or private zone. If the faulty edge is a reciprocal on-premises conditional forwarder, disable only the relevant suffix on one side.

Capture the full link resource before removal: name, resource ID, VNet ID, region, deployment source and last configuration. Prepare the exact IaC commit or deployment command that recreates it. A screenshot is not a rollback artifact.

Use a canary source in the hub before applying the containment broadly. The change is accepted only if the original FQDN resolves, unrelated forwarded suffixes keep working, a non-existent name remains negative, and consumer spokes still follow their expected path.

Validate recovery at DNS and application layers

One successful dig is not recovery. Repeat the original question across several TTL windows from the failing and control cohorts. Preserve latency, response flags, answer and resolver address. Then execute the application transaction that originally failed; a DNS answer can be correct while the client still pins an old address or a connection pool retains a failed endpoint.

text dns-loop-recovery-gate.txt
DNS validation
Original hub source returns the expected answer repeatedly
Intended spoke sources still resolve through the supported path
On-premises source returns the expected answer
UDP and TCP queries behave consistently
Negative control remains NXDOMAIN or the designed negative response
Unrelated forwarded suffixes do not regress

Application validation
Original transaction succeeds from the failing subnet
No fallback to a public address appears
DNS latency and application error rate return to baseline
Monitoring uses the same resolver path as the workload

Evidence to retain
Before and after resolver graph
Ruleset, rule and link resource IDs
Query matrix with UTC timestamps
IaC diff and operator decision
Rollback owner and expiry for the canary window

Decide, promote or roll back

Promote removal of the link only when the graph explains the failure and every positive and negative control passes. Then correct the IaC source so the next deployment cannot recreate the loop. Add a policy or CI check that rejects a ruleset link to the inbound endpoint’s VNet when a rule in that ruleset targets the same inbound endpoint.

Roll back the containment if consumer spokes lose required resolution, another suffix regresses, or the hub still fails in the same way. Recreate the captured link from IaC, confirm the prior state, and continue with the next edge: reciprocal on-premises forwarding, custom DNS configuration, routing or endpoint reachability. Do not compensate by adding records to an unrelated private zone.

Conclusion

A forwarding loop is a graph defect, not a missing-record problem. Freeze one question, inventory every forwarding edge, compare source cohorts, remove only the edge that closes the cycle, and validate both the DNS contract and the application transaction. The production decision is then explicit: keep the narrower topology, or restore the captured link and investigate the next layer without rewriting zones blindly.