dig example.com and nothing comes back. No SERVFAIL, no NXDOMAIN, no answer at all. The command just sits there for 15 seconds, then prints connection timed out; no servers could be reached. Meanwhile, every service that depends on that domain name — your app's API calls, outbound email, webhook deliveries — stalls and queues up behind the same silent timeout. A clean error would at least let retry logic kick in fast. A hang is worse than a failure.
This guide walks through exactly how to trace the authoritative delegation path with dig +trace and packet captures to find which nameserver is silently dropping your queries.
Confirm the hang is real, not local
dig uses whatever nameservers are listed in /etc/resolv.conf. If that resolver is dead or unreachable, every query hangs regardless of the target domain.
Test against a known-good public resolver:
BASH
# Query Cloudflare's resolver directly
dig @1.1.1.1 example.com A +time=5 +tries=1
# Query Google's resolver directly
dig @8.8.8.8 example.com A +time=5 +tries=1- Both return an answer quickly. Your local resolver in
/etc/resolv.confis the problem. Fix that and move on. - Both return SERVFAIL quickly. The authoritative side is broken, but at least the failure is explicit. The public resolvers tried the delegation, got something wrong, and told you.
- Both hang or time out. The authoritative nameservers for that zone are silently dropping queries. This is the scenario worth tracing.
Walk the delegation with dig +trace
dig +trace bypasses your local resolver entirely. It starts at the root nameservers, follows the referrals down through TLD servers, and queries each authoritative nameserver it finds along the way. This lets you see exactly where the chain breaks.
BASH
dig +trace +time=5 +tries=1 example.com A+time=5 flag sets a 5-second timeout per query, and +tries=1 prevents retries so you don't wait forever at a broken step. Default dig behavior (typically 5-second timeout with 3 tries) means a single broken nameserver can stall you for 15 seconds per server.
Read the output in sections. Each section represents one level of the DNS hierarchy:
- Root servers (
.) — You get a referral to the TLD servers (e.g.,.comnameservers). If this step hangs, your machine cannot reach root servers at all, which is a fundamental network problem. - TLD servers (e.g.,
.com) — You get a referral listing the authoritative nameservers for the domain. The NS records and any glue records (IP addresses embedded in the referral) appear here. If the TLD responds but lists nameservers that don't exist or point to wrong IPs, the next step fails. - Authoritative nameservers — This is where the answer (or the hang) lives.
dig +tracetries each NS record it received from the TLD.
BASH
dig @<delegated-ns-ip> subdomain.example.com A +time=5 +tries=1<delegated-ns-ip> with the IP from the referral.
Distinguish "server down" from "silently dropping"
dig returns connection refused relatively fast. A nameserver that hangs is different — it accepts the packet (or at least doesn't reject it) but never sends a response. This pattern often comes from:
- A firewall or security group that allows inbound port 53 but the DNS daemon behind it is misconfigured or crashed, so the packet enters a black hole.
- A DNS server that receives the query but enters an internal loop trying to resolve something it depends on (broken forwarding config, circular delegation).
- An anycast IP where some nodes are healthy and others are not, so queries intermittently succeed or hang depending on which node your packets reach.
- An automation or configuration change that left the zone in a broken state — the server is running but cannot serve that specific zone, and instead of returning SERVFAIL, it simply doesn't respond.
BASH
# Capture DNS traffic to/from a specific nameserver IP
# Run this in one terminal, then run your dig command in another
tcpdump -nn -i any host <nameserver-ip> and port 53BASH
dig @<nameserver-ip> example.com SOA +time=3 +tries=1Check all listed nameservers, not just one
BASH
dig +short example.com NSBASH
dig @ns1.example.com example.com A +time=5 +tries=1
dig @ns2.example.com example.com A +time=5 +tries=1When the problem is upstream and you can't fix it
api.vendor.com, their authoritative DNS is broken, and your app hangs waiting for resolution.
Short-term mitigations:
- Lower your resolver's timeout. If you run your own recursive resolver (BIND, Unbound, PowerDNS Recursor), reduce the query timeout so it returns SERVFAIL faster instead of waiting the full default period. For Unbound, the directive is
serve-expired: yescombined with a shorterjostle-timeout. For BIND,resolver-query-timeoutcontrols this. Check your resolver's documentation for exact syntax. - Cache aggressively. If the domain resolved successfully before, a resolver with serve-stale (RFC 8767) capability can keep returning the cached answer even after TTL expiry, buying time during an upstream outage.
- Set application-level DNS timeouts. Most HTTP client libraries let you set a DNS resolution timeout separately from the connection timeout. Use it. A 2-second DNS timeout with a fast retry to a secondary resolver is better than a 30-second hang.
The practical takeaway
dig @1.1.1.1), walk the delegation to find which level breaks (dig +trace), test each nameserver individually, and confirm packet-level behavior with tcpdump when the answer isn't obvious. Once you know which server is dropping queries, you either fix it, remove it from the NS set, or protect your applications with shorter timeouts and stale-cache serving.