All ArticlesDevOps2026-11-14T23:20:40+08:00

Retry Amplification Turned a DNS Blip Into a Global Outage — How the Feedback Loop Works

Your microservice SDKs retry failed DNS queries aggressively without backoff or jitter, and you need to understand why that converts a small latency spike into a self-inflicted DDoS. After reading, you will know exactly how recursive resolver loops and synchronous retries multiply packet load exponentially, and how to evaluate backoff strategies to break the cycle.

A DNS resolver gets slow for two seconds. Maybe an upstream nameserver hiccupped, maybe a network path flapped. Two seconds later, the resolver recovers — but your platform is now in a full cascading outage. Every microservice is timing out, queues are backing up, and your monitoring dashboards show traffic patterns that look like a DDoS attack. Except nobody is attacking you. Your own infrastructure is doing it to itself.

This is retry amplification. It is one of the most common ways a minor DNS latency spike becomes a global incident, and understanding the mechanics — how packets multiply at each layer of the resolution chain — is the key to preventing it.

How DNS Resolution Stacks Up

Before looking at what goes wrong, it helps to trace what happens during a normal DNS query from inside a microservice.

When your application calls getaddrinfo() (or whatever your language runtime wraps around it), the request hits the stub resolver — a minimal DNS client built into the OS. On most Linux systems, this is part of glibc (or musl in Alpine-based containers). The stub resolver reads /etc/resolv.conf, picks a nameserver, sends a UDP packet, and waits.

That nameserver is typically a recursive resolver — something like your cloud provider's internal resolver, or a local instance of Unbound, BIND, or CoreDNS. The recursive resolver checks its cache. On a cache miss, it walks the DNS hierarchy: root servers, TLD servers, authoritative servers. Each step is a separate UDP round-trip.

So a single application DNS query can fan out into multiple upstream queries at the recursive resolver level. This is normal and fast when everything works. The problem starts when something slows down or fails at any point in this chain.

Where Retries Multiply

The stub resolver in glibc has built-in retry logic. By default, it typically waits around 5 seconds for a response, then retries. If you have two nameservers listed in resolv.conf, it tries the first, waits, tries the second, waits, then cycles back. The exact behavior depends on the timeout and attempts options in resolv.conf, but the point is: one application query that gets no answer can generate several DNS packets at the stub level before giving up.

Now zoom out. Your application is not making one query. A single HTTP request from a microservice might need to resolve the database hostname, the cache hostname, a downstream API endpoint, and maybe an auth service. Each of those is a separate DNS query. And you probably have hundreds or thousands of instances of that microservice.

Here is where the multiplication gets dangerous. Consider three layers where retries happen independently:

  1. Application/SDK layer. Many HTTP client libraries and service discovery SDKs have their own retry logic on connection failure. DNS resolution failure counts as a connection failure. The SDK retries the whole request, which triggers a fresh DNS query.

  2. Stub resolver layer. Each DNS query from the SDK gets retried by the OS stub resolver according to resolv.conf settings.

  3. Recursive resolver layer. The recursive resolver, on a cache miss or upstream timeout, retries its own queries to upstream authoritative servers.

Each layer multiplies independently. If your SDK retries 3 times, the stub resolver sends 2 packets per attempt, and the recursive resolver makes 3 upstream queries per inbound query, a single failed application request generates 3 × 2 × 3 = 18 upstream DNS packets. Multiply that by thousands of microservice instances making requests concurrently, and you get packet counts in the millions within seconds.

The Feedback Loop That Makes It Worse

The multiplication alone is bad. The feedback loop is what turns it catastrophic.

When the recursive resolver gets overloaded by the flood of retry packets from all your stub resolvers, it starts responding slowly — or not at all. This causes more timeouts at the stub resolver layer, which triggers more retries. Those retries add more load to the already-overloaded recursive resolver, which makes it even slower, which causes even more retries.

This is a positive feedback loop in the engineering sense: the output (slow DNS) feeds back into the input (more DNS queries) in a way that amplifies the original signal. A 2-second upstream blip becomes a 20-minute platform outage because the retry traffic sustains itself long after the original cause is gone.

The pattern has been observed in major cloud and DNS infrastructure failures. Resolvers re-query upstreams, multiplying packet load exponentially. Client-side libraries and microservice SDKs retry aggressively and synchronously, converting a regional latency blip into what looks like a global DDoS against your own infrastructure.

There is an additional nasty detail: synchronized retries. When a resolver goes slow, all the clients that were waiting time out at roughly the same moment. They all retry at roughly the same moment. This creates a thundering herd — a sharp spike of packets that hits the resolver simultaneously, which is far worse than the same number of packets spread over time. The resolver might have been able to handle the total volume if it arrived smoothly, but the synchronized burst overwhelms it.

Why Default Retry Settings Make This Likely

Most retry defaults were designed for a world where DNS failures were rare and isolated. The glibc stub resolver's defaults assume that if one nameserver is down, the other is probably fine. SDK-level retries assume that transient failures are brief and independent. Neither assumption holds when the failure is caused by overload at a shared recursive resolver.

You can inspect your current stub resolver behavior:

cat /etc/resolv.conf

Sample output format:

nameserver 10.0.0.2
nameserver 10.0.0.3
options timeout:5 attempts:2

The timeout value (in seconds) and attempts count control how aggressively the stub resolver retries. Lower values mean faster failover but more packets during an outage. Higher values mean slower failover but less amplification. There is no free lunch here.

At the SDK level, the defaults vary widely. Some HTTP client libraries retry immediately on connection failure with no backoff at all. Some retry a fixed number of times with a fixed delay. Few ship with jitter enabled by default. You need to check the documentation for whatever libraries your services use — the defaults are often more aggressive than you expect.

Breaking the Loop With Backoff and Jitter

Two mechanisms break the feedback loop: exponential backoff and jitter.

Exponential backoff means each successive retry waits longer than the previous one. Instead of retrying at 1s, 1s, 1s, you retry at 1s, 2s, 4s, 8s. This reduces the total packet rate over time, giving the overloaded resolver a chance to recover.

But exponential backoff alone does not solve the thundering herd problem. If all clients back off on the same schedule, they still retry in sync — just less frequently. That is where jitter comes in. Jitter adds a random component to the wait time. Instead of retrying at exactly 4 seconds, one client retries at 3.2 seconds, another at 4.7 seconds, another at 3.9 seconds. This spreads the retry traffic over time, converting a sharp spike into a manageable trickle.

The combination matters. Backoff without jitter still produces synchronized bursts. Jitter without backoff still produces too many total retries. You need both.

A common approach is "full jitter" exponential backoff: the wait time for retry N is a random value between 0 and (base_delay × 2^N), capped at some maximum. The cap prevents absurdly long waits. As an illustrative example, with a 1-second base delay and a 30-second cap:

  • Retry 1: random between 0 and 2 seconds
  • Retry 2: random between 0 and 4 seconds
  • Retry 3: random between 0 and 8 seconds
  • Retry 4: random between 0 and 16 seconds
  • Retry 5: random between 0 and 30 seconds (capped)

This is not the only valid strategy. "Decorrelated jitter" and "equal jitter" are alternatives with different trade-offs in average wait time versus spread. The right choice depends on your latency tolerance and how many clients are retrying simultaneously.

What to Evaluate in Your Stack

Retry amplification is a systemic problem, not a single misconfiguration. Breaking it requires looking at every layer.

Stub resolver settings. Review resolv.conf on your containers and VMs. If you are running many microservice instances pointing at the same recursive resolver, consider whether the default timeout and attempts values are appropriate. Reducing attempts to 1 and lowering timeout can reduce amplification, but it also means legitimate transient failures cause faster errors to the application. Trade-off, not a free fix.

SDK and library retry policies. Audit the HTTP clients, gRPC clients, database drivers, and service discovery libraries your services use. Look for: default retry count, whether backoff is enabled, whether jitter is enabled, and whether DNS resolution failures are treated differently from connection failures. Many libraries let you configure a custom retry policy — use it.

Recursive resolver capacity and caching. If your recursive resolver serves thousands of pods, it needs enough capacity to handle burst traffic. Negative caching (caching SERVFAIL responses briefly instead of re-querying immediately) can significantly reduce upstream load during an incident. Check whether your resolver has negative caching enabled and what TTL it uses for failed queries.

Local DNS caching. Running a lightweight caching resolver (like a dnsmasq or nodelocaldns sidecar) on each node reduces the number of queries that reach the central recursive resolver. Cached answers are served locally, so only cache misses generate upstream traffic. This does not eliminate retry amplification, but it reduces the blast radius.

For a deeper look at how recursive resolver failures cascade into microservice connection problems, the article on checking recursive resolvers when microservices fail to connect covers the diagnostic side. And if you want to understand how retry storms specifically worsen DNS timeouts through feedback loops, this piece on retry storm feedback loops walks through the cascading timeout mechanics.

The Practical Takeaway

Retry amplification is not exotic. It is the default behavior of most stacks under DNS stress. Every layer retries independently, every retry generates real packets, and synchronized retries create bursts that overwhelm the very infrastructure they are trying to reach. The fix is not removing retries — you need retries for resilience. The fix is making retries aware of each other's existence, at least statistically, through backoff and jitter. Audit your SDK defaults, check your resolv.conf, and make sure your recursive resolver has enough headroom and negative caching to survive the burst that comes when something upstream hiccups for two seconds.