Try
↑ ↓ move↵ openesc close

Interview prep / DNS and traffic steering

Mid · DNS and traffic steering · System design interview question

Your health check removes a dead endpoint from DNS in 10 seconds. Why do users still fail for longer?

Sketch your own answer first, then compare it with the one below.

A strong answer

Resolvers cached the old answer, and they keep it until the TTL ends. A resolver that refreshed just before the change keeps the dead address for one full TTL. So the worst case is the detection time plus the TTL.

Some resolvers and applications hold answers longer than the TTL, so the real delay can be longer still.

To cut it, use a short TTL on records you may need to move, let clients retry another address when one fails, and put a load balancer or anycast address in front so that failover does not depend on caches.

Sources

Learn it by running it

The dns and traffic steering lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms