Networking
Azure DNS: diagnose persistent NXDOMAIN after fixing a record
A production runbook for separating negative caching, private zones and resolution paths before changing DNS or restarting an application.
An application on an Azure VM cannot resolve api.internal.example. Its A record has just been created in a private DNS zone linked to the VNet, yet some clients still receive NXDOMAIN. Restarting every application or flushing every cache can hide the cause and disrupt unrelated services.
This is a fictional example. Adapt the name, addresses and DNS path to your environment. The approach applies to an internal private zone whether or not it serves a Private Endpoint. A Private Endpoint supplies a private address for a resource; it does not, by itself, ensure that every client resolves the right name.
Capture the path and evidence
Record the correction time in UTC, the exact fully qualified name, query type, affected clients, their VNets and the resolvers they actually use. Preserve complete replies, including response code, CNAME chain, Authority section and TTLs. Check zone links, views and effective forwarding rules before assuming all clients reach the same zone.
From a representative Linux client, compare its configured resolver with an identified intermediate resolver. Replace the example address with your own. Query Azure DNS directly only from a path where it is reachable and in the relevant VNet context.
date -u
cat /etc/resolv.conf
dig api.internal.example. A +noall +comments +answer +authority
dig @10.0.0.4 api.internal.example. A +noall +comments +answer +authority
dig @10.0.0.4 api.internal.example. AAAA +noall +comments +answer +authority
dig @168.63.129.16 api.internal.example. A +noall +comments +answer +authority On a host using systemd-resolved, resolvectl status helps identify per-link DNS servers and domains. dig may not reproduce the application’s full path: a library, process cache, proxy or container can use different settings. Repeat the test in that context and compare the servers actually queried.
Separate negative answers from resolution failures
| Observation | Hypothesis | Next check |
|---|---|---|
| Azure DNS returns the expected address; the client resolver returns NXDOMAIN | Negative cache or different paths | Repeat the query, inspect remaining TTL, forwarding and VNet context |
| Azure DNS also returns NXDOMAIN | Record absent from the zone actually queried, incorrect link or name | Zone, record set, VNet link and CNAME chain |
| NOERROR without an A answer, but an AAAA answer or the reverse | Name exists, but the requested type may not | Check A and AAAA separately; distinguish NODATA from NXDOMAIN |
| SERVFAIL or timeout | Resolution or transport failure, not proof that the name is absent | Resolver logs, forwarding, connectivity and upstream health |
| DNS answer is correct but the application fails | Application cache, existing connection, TLS or destination service | Test in the process or container, then inspect connection and application logs |
NXDOMAIN is a negative answer for a name; NODATA means no data of the requested type was found, without necessarily saying the name does not exist. With a CNAME chain, inspect each name and the Authority section: the missing name may be the target, not the original alias.
Under RFC 2308, the initial negative TTL is bounded by the smaller of the SOA TTL and its MINIMUM field. A cached response’s observed TTL can count down; local policies and multiple cache layers complicate the estimate. A negative response without a usable SOA, or a stable discrepancy after expiry, calls for path investigation before blaming the cache. The Microsoft guide covers private-zone and forwarding discrepancies.
Change one layer at a time
If the source queried in the correct VNet still gives the wrong answer, first correct the identified record set, link or forwarding rule with the DNS owner, after saving the prior configuration. Check the effect on other names and clients; do not create a parallel zone or a broad fallback rule merely to silence one symptom.
If the source is correct and a specific cache remains negative, wait for expiry when the impact permits. Otherwise, with approval, use the product’s procedure to evict only the affected name and type if supported. A global flush affects other answers and may temporarily increase upstream load: document its scope and risk. Do not assume that flushing a local cache also clears a forwarder or application cache.
Validate and retain a rollback
From a previously affected client and a control client, check A and AAAA again, including response code, chain and expected address. Then test the real application path using its normal hostname and TLS settings, and correlate application logs. Observe beyond the cache lifetime seen in the evidence and confirm that other names in the zone still resolve correctly.
If a zone, link or forwarding change harms another flow, restore its known configuration under the change procedure and repeat the same tests from both clients. A cache flush cannot be undone, and cached answers can outlive a configuration rollback: monitor their expiry. If the path remains ambiguous, stop making changes and hand the timestamped answers and topology to the DNS owner.