Design a Caching DNS Resolver Like Google Public DNS

Last updated: November 29, 2026

Quick Overview

Design a public recursive DNS resolver service (like 8.8.8.8) that answers billions of queries per day with low latency from anycast locations worldwide, caching records correctly and resisting spoofing and amplification abuse.

Google
System Design
Software Engineer
Google
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design a public recursive DNS resolver service (like 8.8.8.8) that answers billions of queries per day with low latency from anycast locations worldwide, caching records correctly and resisting spoofing and amplification abuse.

Google Public DNS is a global caching system with strict protocol semantics, a good test of caching beyond key-value stores. Interviewers check TTL correctness, cache sharing across machines in a site, prefetching, and security concerns specific to DNS.

What the Interviewer Expects
  • Use anycast to route users to the nearest site
  • Cache by (name, type, class) honoring TTLs and negative caching
  • Share cache across servers in a site to raise hit rate
  • Prefetch popular records before expiry
  • Defend against cache poisoning and amplification attacks
Key Topics to Cover
anycast
TTL caching
negative caching
cache poisoning
prefetch
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you handle EDNS Client Subnet when CDNs return location-specific answers?
  • How would you rate limit abusive clients without breaking large NATs?
  • What happens when an authoritative server is slow or down?
  • How do you keep caches warm after a site restart?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements
  • Recursive resolution for any domain over UDP, TCP, DNS over HTTPS and TLS.
  • Median latency low single-digit ms for cached answers.
  • Correctness: never serve records past their TTL (except serve-st...
High-Level Design
  • Anycast sites: same IP announced from many locations; each site has load balancers and many resolver servers.
  • Two-level cache: a small per-server cache and a shared site cache tier, partit...

Submit Your Answer
Markdown supported