Troubleshoot selective DNS failures with controlled UDP and TCP queries, packet evidence, and scoped firewall rules for approved resolvers.
Observe answer or truncation
Verify handshake and DNS response
Same resolver, name, and record type
Recognize the selective-failure pattern
Users can browse familiar websites but one application cannot resolve its hostname. A small DNS lookup succeeds, while another query times out. This pattern can lead teams to blame the domain before checking the transport. Traditional DNS uses both UDP and TCP, and TCP support is a normal part of DNS operation rather than a feature reserved only for zone transfers.
One possible cause is an ACL that permits UDP 53 but blocks TCP 53. It is only a hypothesis until you compare matching queries. Resolver policy, DNSSEC validation, authoritative-server trouble, packet loss, fragmentation, and cached results can produce different forms of selective failure.
Control the resolver and query
Use the same client, explicit resolver, fully qualified name, and record type in each test. Replace the illustrative resolver 10.20.0.53 and hostname app.example.com with approved values. The examples require dig, commonly available through BIND utilities. They perform queries and do not change firewall settings.
The first command asks over UDP and prevents automatic TCP retry so you can inspect that response independently. The second forces TCP. Read the full output, including status, flags, server, query time, and answer section. A truncated response has the TC flag. Do not mistake an automatic fallback for proof that UDP alone delivered the complete answer.
dig @10.20.0.53 app.example.com A +notcp +ignore +time=2 +tries=1
dig @10.20.0.53 app.example.com A +tcp +time=2 +tries=1
Interpret the comparison carefully
If UDP returns an answer and TCP times out, investigate the TCP path and listener. If UDP is truncated and TCP fails, the fallback path is a strong candidate for that query’s failure. If both return NXDOMAIN, the resolver answered that the queried name does not exist. That response is different from a transport timeout.
SERVFAIL is also an answer, but it does not identify the root cause by itself. Compare resolver logs and validation results. If both transports work in your controlled test while the application still fails, confirm that the application uses the same resolver. Browser encrypted DNS, local caching, search suffixes, and VPN DNS settings can make those paths differ.
Locate the break with packet evidence
Capture narrowly around the approved client and resolver while repeating one query. On a permitted Linux capture point, the bounded example below includes both TCP and UDP port 53. DNS captures expose names and infrastructure details, so handle them as operational data and redact before external sharing.
For TCP, determine whether the SYN leaves, the SYN-ACK returns, and the DNS exchange follows the handshake. For UDP, compare the request and response and inspect truncation. A successful handshake without a DNS response points to a different next check from a SYN that never reaches the resolver. Also check any resolver-to-upstream path separately from the client-to-resolver path.
sudo tcpdump -ni any -c 30 'host 10.20.0.53 and port 53'
Apply and verify a scoped correction
If transport filtering is confirmed, permit the necessary TCP and UDP DNS flows between approved clients and resolvers according to your architecture. Do not turn the finding into unrestricted outbound DNS for every endpoint. Preserve resolver policy and monitoring, then repeat the same tests through the actual user path.
Verify a small response, the previously failing name, and a query that exercises the relevant large-response behavior. Record the resolver, name, record type, response status, transport, and application result. These examples cover traditional DNS on port 53. DNS over TLS and DNS over HTTPS require separate analysis of their configured endpoints and transports.
References and further reading
RFC 9210, DNS transport operational requirements