Load Balancing Proxies

DNS (Domain Name System)

0 of 13 complete

0%

Contents

Back|Load Balancing ProxiesDNS (Domain Name System)
1/13
37 min left
  1. Home
  2. System Design: Foundation
  3. Load Balancing & Proxies
  4. DNS (Domain Name System)
Related Topics
LatencyCore FundamentalsBandwidthCore FundamentalsConnection TimeoutCore FundamentalsRequest TimeoutCore FundamentalsStatic IPCloud Infrastructure
Previous lessonSQL vs NoSQLNext lesson
1 of 13
Unicast Routing

System Design

  • Foundation
  • Intermediate
  • Advanced
  • Capstone

AI Engineering

  • Foundation
  • Data, RAG and Agents
  • Evaluation, LLM Ops and Security

systemdesign.academy

  • Home
  • Glossary
  • Interview prep
  • Reviews
  • About
  • Privacy
  • Terms

this free lesson is part of

System Design Masterclass

  • 770 lessons, beginner to principal
  • 90 real interview systems taken apart step by step
  • An AI tutor beside every lesson that answers and draws
  • Lifetime access, every new lesson included

$49 once, by PayPal

See the System Design course

Save your progress and get the interview checklist PDF

System Design Interview Cheat Sheet: the 7 interview stages, the 10 points a scorecard grades, 12 classic systems. 18 pages. Free with an account.

you just read a free lesson from

System Design Masterclass

  • 770 lessons, beginner to principal
  • 90 real interview systems taken apart step by step
  • An AI tutor beside every lesson that answers and draws
  • Lifetime access, every new lesson included

$49 once, by PayPal

See the System Design course

The Thing That Breaks and Takes Everything With It

Try memorising 142.250.80.46. Now do it for every site you use: your bank, your email, Netflix, GitHub, that recipe blog you found at one in the morning.

Nobody does that. You type a name, and something translates it into an address. That something is DNS, and it is so deeply assumed that most engineers never think about it until the day it stops.

When it stops, everything stops. In October 2021 Meta was unreachable for about six hours. Not just Facebook: Instagram, WhatsApp, Messenger, all of it, for billions of people.

You will often read that this was a DNS misconfiguration. It was not, and the real story is more useful. A command issued during routine maintenance took down the connections between Meta's data centres. Their DNS servers are built to notice when they have lost data centre connectivity and, when they do, to stop advertising themselves to the internet. That is a deliberate and correct safety behaviour: a server that cannot reach anything behind it should not keep claiming it can serve. So the DNS servers withdrew their own routes, exactly as designed, and the effect was that Meta's authoritative name servers vanished from the internet entirely.

Nothing in DNS malfunctioned. DNS was the symptom everybody saw, three steps downstream of the cause.

A causal chain. A maintenance command takes the backbone down, so data centres are cut off from each other. The DNS servers see they are isolated and, correctly, withdraw their own routes. The world can no longer reach the DNS servers. From that, two consequences: every Meta name stops resolving, and badge readers and internal tools stop resolving too, which means engineers cannot get into the building.
FlowchartFigure 1. It is remembered as a DNS outage, and DNS was working perfectly

Every box in this chain behaved as designed. The withdrawal in the middle is a safety feature, not a bug: a name server that has lost contact with everything behind it should stop telling the world it can serve.

Read the two branches at the bottom together, because that is where the real lesson is. Anything that has to keep working while you fix an outage must not depend on the thing that is broken, and their door badges depended on their own DNS.

There is a detail from that day worth carrying with you for the rest of your career: the engineers could not get into the buildings, because the badge readers needed name resolution too.

This lesson is longer than most because DNS is one of the few systems you will interact with every single day of your working life, and knowing it properly pays for itself many times over.

after “The Thing That Breaks and Takes Everything With It”

Could you draw this on a whiteboard tomorrow?

In the System Design course, the next step is Global Server Load Balancing (GSLB).

You come away able to explain the trade-offs out loud.

Look inside the System Design course

What DNS Actually Does

DNS answers one question: what address does this name point to?

When you type github.com, your computer cannot do anything with that string. Network protocols need IP addresses. DNS is the system that turns one into the other.

The comparison to a phone book is the usual one and it is slightly wrong, because a phone book is a single document that somebody prints. DNS is nothing of the sort. There is no list of every domain anywhere in the world, and there never has been.

A sequence diagram with four lifelines: your browser, a recursive resolver such as 1.1.1.1, the root and TLD servers described as the delegation chain, and the authoritative server that holds the real record. The browser asks the resolver where www.example.com is. The resolver asks the delegation chain who runs .com and gets back a referral rather than an answer. The resolver then asks the authoritative server, which returns 93.184.215.14 with a TTL of 300, and the resolver passes that back to the browser and keeps it for 300 seconds.
SequenceFigure 2. Nobody has a list of every domain, so the question gets passed along

Your machine does almost nothing. It asks one server, the recursive resolver, and waits.

That resolver does the walking, and the servers it walks are operated by completely different organisations. The middle steps return referrals, meaning "not me, but I know who to ask". Only the last server in the chain actually holds the record.

Three properties follow from that picture and they explain almost everything else in this lesson.

DNS is hierarchical and delegated. No server knows the whole namespace, and none needs to.

DNS is cached at every layer. That is what makes it fast, and it is what makes changes slow.

It is a small key-value store attached to a name, and the address is only one of the things in it.

A Domain Name Is a Path, Read Backwards

A tree diagram. At the top, the root, described as 13 addresses worldwide, branching to .com, .org and .academy. The .academy branch leads to systemdesign.academy served by ns55.domaincontrol.com, which branches to www and to the apex itself at 216.150.1.1. The .com branch leads to github.com.
FlowchartFigure 3. Read a domain name backwards and it is a path down a tree

There is an invisible dot at the end of every domain name and it is the root. www.systemdesign.academy is really www.systemdesign.academy., read right to left.

Each level delegates the level below it to somebody else's servers. The root operators have never heard of systemdesign.academy and never need to: they only know who runs .academy.

Delegation is the entire architecture, and it is why anybody can register a domain without a central authority adding a record for them. The registry for .academy adds a delegation, and everything below that name becomes somebody else's problem, permanently.

It is also why DNS survives. There is no single database to corrupt, no single operator to take offline, and no single point where a mistake breaks the whole namespace.

What a Zone Actually Contains

A DNS record is four things: a name, a type, a value, and a . That is the entire data model.

A table of six DNS record types with real fetched values. A maps a name to an IPv4 address: systemdesign.academy to 216.150.1.1, TTL 600. CNAME makes a name an alias for another name: www.systemdesign.academy to a vercel-dns hostname, TTL 3600. NS says who is authoritative: systemdesign.academy to ns55.domaincontrol.com, TTL 3600. MX says where mail goes: github.com to a mail.protection.outlook.com host, TTL 300. TXT holds arbitrary text used for verification, on github.com, TTL 59. SOA holds the zone's own metadata and timers, with a minimum of 600.
FigureFigure 4. A zone is a small key-value store, and only one row of it is an address

Every value in the right-hand column was fetched over DNS-over- while this lesson was being written, from this course's own domain and from github.com. None of it is invented.

The TTL column is the one worth studying. It varies from 59 seconds to an hour on these six records alone, and the short ones will already have moved by the time you read this. Query them and see.

Roughly half the DNS problems you meet in practice are a wrong record type, not a wrong value. Mail not arriving is almost always MX. A vendor telling you the domain is not verified is almost always TXT. The website being fine while mail is broken is not a contradiction, it is two different record types often served by two different providers.

One correction to advice you will still see repeated: dig example.com ANY no longer returns everything. Since RFC 8482 most providers, Cloudflare included, deliberately refuse ANY queries because they were an amplification vector for attacks. Query the types you want, one at a time.

Why It Feels Instant

If every lookup walked the whole chain, every first request to every domain would cost a few hundred milliseconds before anything else could start. It does not, because the answer is cached at every layer between you and the authoritative server.

An isometric stack of five slabs, labelled from the top: browser, milliseconds away; operating system, same machine; your router, same building; the resolver, your ISP or 1.1.1.1; and at the bottom root, TLD and authoritative, described as the actual internet. A line beneath reads that a query enters at the top and stops at the first layer that still remembers.
IsometricFigure 5. Five caches deep, and most lookups never leave your own machine

A hit at the browser layer costs nothing at all, and for a site you use regularly that is the normal case.

Every layer down is further away, and the bottom one is somebody else's continent. Each layer honours the independently, on its own clock, which is why a record's real lifetime in the world is longer than its TTL.

On Windows you can list your machine's cache with ipconfig /displaydns. On macOS there is no supported way to print it. sudo dscacheutil -flushcache is the command you will see quoted for this and it clears the cache rather than showing it, which is worth knowing before you run it while debugging.

The TTL is the only lever you have

A line chart of the percentage of clients reaching the new server against hours after the record was changed. With a 300-second TTL the line jumps to 100 percent almost immediately. With a one-hour TTL it reaches 100 percent after an hour. With a one-day TTL it climbs gradually across the full 24 hours. A note reads: a full day of traffic split across two servers.

The Rules That Catch Everyone Once

Three things about DNS surprise almost every engineer the first time, and all three cost an afternoon when they do.

You cannot alias your bare domain

A hand-drawn diagram in two rows. The top row shows what you want, example.com as a CNAME to myapp.vercel.app, with an arrow to a red box reading that RFC 1034 forbids it because the apex must carry SOA and NS. The bottom row shows what works, www.example.com as a CNAME to myapp.vercel.app, next to a green box explaining that a subdomain has no SOA so an alias is legal there. Handwritten notes beneath say that at the apex your provider fakes it with ALIAS, ANAME or CNAME flattening, and that all three resolve the target themselves and serve you a plain A record.
SketchFigure 7. You cannot point your bare domain at a hostname, and here is why

A CNAME says "this name IS that name", so the standard forbids attaching anything else to it. The zone apex is required to carry an SOA record and its NS records. Those two rules cannot both be satisfied at once.

Subdomains have neither requirement, which is why www has worked this way since 1987 and your bare domain has not.

ALIAS, ANAME and CNAME flattening are provider features rather than DNS features. The provider resolves the target on your behalf and hands out an ordinary A record, which also means the answer is only as fresh as the provider's own polling of the target.

A "does not exist" is cached too

A sequence diagram with three lifelines: you, a resolver, and an authoritative server. You ask for api.example.com. The resolver asks the authoritative server, which returns NXDOMAIN plus the zone's SOA, noted as the SOA's minimum field being the negative TTL. The resolver tells you no such name. You say you just created it and ask it to try again, noted as being cached as not-existing so the request never reaches the authoritative server.

Your Queries Are Not Private, and Not Even Trustworthy

A classic DNS query is unencrypted UDP, sent in the clear, to a server that never proves it is the server you asked.

A table comparing three DNS transports. Do53 on port 53 UDP is plaintext, and anyone on the path can rewrite the answer. DoT on port 853 TCP wraps it in TLS, so nobody on the path can. DoH on port 443 TCP wraps it in TLS inside HTTPS, so nobody on the path can. A note beneath says DoH is harder to block because it is indistinguishable from ordinary web traffic, which is exactly why some networks and administrators dislike it.
FigureFigure 10. The oldest thing your computer does is also the least protected

DoT wraps the same protocol in TLS on its own port, which is straightforward for a network to block. DoH puts it inside ordinary , so it looks like any other web request.

Neither hides your query from the resolver you chose. They hide it from everything between you and that resolver.

The privacy argument is the one usually made for encrypted DNS, and it is the weaker one. The stronger argument is integrity, and it is easy to demonstrate rather than assert.

A recorded terminal session. Three different root server addresses, 198.41.0.4, 192.33.4.12 and 199.7.83.42, are each asked for the NS records of .academy with recursion disabled. All three return identical replies with the flags qr and ra, zero answers, thirteen authority records, and the root itself as the first name. A query for hostname.bind sent to a root server returns alliance-48, which is not a root server operator. A query for whoami.cloudflare sent to 1.1.1.1 returns nothing at all. The same .academy question sent over HTTPS to Cloudflare returns the real delegation, v0n0.nic.academy and its siblings.

One Real Domain, End to End

Everything above becomes concrete very quickly if you resolve a real name and look at what comes back.

A recorded terminal session using DNS-over-HTTPS. A query for www.systemdesign.academy type A returns a CNAME with TTL 3600 to a vercel-dns hostname, followed by two A records with TTL 300. A query for systemdesign.academy type CNAME returns zero CNAME records, noted as RFC 1034 forbidding one there. A query for systemdesign.academy type A returns a single A record with TTL 600. The CNAME query's authority section carries the SOA from ns55.domaincontrol.com with refresh 28800, retry 7200, expire 604800 and minimum 600, noted as the negative cache TTL.
RecordedFigure 13. One lookup, three records, and the apex playing by different rules

The name you typed is three records deep: www is a CNAME to a Vercel hostname, and that hostname resolves to two addresses. Every one of those is a separate cache entry with its own , and they are different: 3600 on the alias and 300 on the addresses.

The bare domain has no CNAME at all, exactly as the apex rule requires, and carries a plain A record instead.

The SOA in that capture is worth reading field by field, because the last one is the negative cache TTL from the previous slide. Six hundred seconds. That is how long a resolver here will remember that a name under this domain does not exist.

Notice also that these queries went over rather than through dig. That is not a stylistic choice. Given what the previous capture showed about this network, a dig here would have been reporting the middlebox's opinion.

DNS as Infrastructure, Not Just Lookup

Once you stop thinking of DNS as a phone book, it becomes something more interesting: the first routing decision in every connection, made before a single packet reaches your servers.

Thirteen addresses, far more than thirteen servers

An isometric scatter of six server blocks labelled Frankfurt, London, Tokyo, Virginia, Singapore and Mumbai, with the Mumbai one raised and highlighted. A label reads that 198.41.0.4 is not one machine and that all of these answer to it. A line beneath reads that the network's own routing picks the nearest one, and you never chose.
IsometricFigure 14. There are 13 root server addresses and many more root servers

The root of DNS has thirteen addresses, a number that came from old packet size limits rather than from thirteen machines existing. Each of those addresses is announced from many sites around the world by its operator.

Your packet goes to whichever announcement the network considers closest, and you never made that choice.

This is anycast, and it is a routing feature rather than a DNS one. It is also most of what keeps the root of DNS standing under attack: a flood aimed at one address arrives at many machines instead of one.

The same name, a different answer

A figure headed one query, three different answers depending on where you asked from. A user in Tokyo gets an edge in Tokyo, a user in London gets an edge in London, a user in Mumbai gets an edge in Mumbai. Below, three providers with logos: Cloudflare using anycast where one address lets the routing pick the site, Route 53 with latency and geolocation policies plus health checks, and Google Cloud DNS with geo-aware routing over Google's own network.

Where DNS Stops Being the Answer

Two columns. DNS is the right tool for sending users to a nearby region, moving a domain to a new host, failing over between data centres, and blue-green cutover, all described as decisions that change rarely or that you control the timing of. DNS is the wrong tool for failing over in under a second, routing by user or session, splitting traffic 95 to 5, and reacting to load, all described as needing per-request decisions that DNS cannot make.
FigureFigure 18. Everything DNS is bad at, it is bad at for one reason

Every item on the left changes slowly and can wait for caches to expire. Every item on the right needs a decision to take effect now, or to differ per request.

DNS has exactly one lever, the , and a cached answer cannot be taken back.

You do not have to memorise those two lists. Derive them from one sentence: DNS can only make decisions that tolerate being stale.

When you need something from the right-hand column, the answer is a or a proxy, which sees every individual request and can decide per request. Those are the next several lessons in this chapter, and this is precisely why they exist.

The other failure mode

A hand-drawn diagram. October 2016, Dyn is flooded by a botnet. On the left, a green box: Twitter, Reddit, Netflix, Spotify and GitHub servers all healthy and all serving. On the right, a red box: their DNS provider cannot answer a single query. Arrows from both lead down to a red box reading every one of them is unreachable. A handwritten note reads that an address nobody can look up is the same as a server that is down.
Sketch

The Two Procedures Worth Memorising

Changing where a domain points

A five-step numbered runbook. One, at least one old TTL before: lower the TTL to 300, because caches must expire once to learn the new number. Two, then wait: do nothing at all, described as the step everybody skips and the whole trick. Three, cutover day: change the record, and the world follows within about five minutes. Four, watch both servers for one TTL, because some clients ignore TTLs so expect a tail. Five, after a day: raise the TTL back, because a 300-second TTL is a permanent query tax.
FigureFigure 20. The first step of a DNS migration happens a day before the migration

Step one exists because resolvers are holding your old rather than your new one. Step two is not caution, it is the mechanism doing its work.

Step four is real: a small number of clients hold records well past their stated TTL, so plan for a tail rather than a clean switch.

If somebody tells you the migration is tomorrow and the TTL is still 86400, the honest answer is that tomorrow is too soon. Either move the date or accept a day of split traffic, and say out loud which one you chose.

Working out what broke

A table of five symptoms with their almost-always cause and what to do. Created the record and it still says it does not exist: negative caching, wait out the SOA minimum or query a resolver that never asked. Some users see the old server and some the new: the old TTL, expected during a cutover. It works for me and not for them: different resolvers, compare answers from 1.1.1.1, 8.8.8.8 and their own. Mail bounces but the website is fine: MX not A, a different record type often from a different provider. Intermittent failures on one domain only: TCP 53 blocked, so large answers truncate and the retry never completes.

What DNS Costs You on Every First Visit

A bar chart of milliseconds for four phases in order: DNS, TCP handshake, TLS handshake, and the request itself. The cold first visit shows a bar for each phase. The warm return visit shows nothing for the first three and only the request. A note reads that nothing here overlaps and they are strictly serial.
ChartFigure 22. Nothing about your page can start until the name has been resolved

Illustrative durations rather than a measurement of your network, but the ordering is exact. A cold DNS lookup has to complete before can open, and TCP has to complete before TLS can negotiate.

None of these can start early, and a page pulling fonts, analytics and images from six different domains pays this cost six times.

There are two fixes and they are not equal. A dns-prefetch or preconnect hint in your page head resolves a domain before the browser needs it, which helps. Reducing how many separate domains your page touches at all helps considerably more, and also fixes several other problems at the same time.

Which resolver

For years most people used whatever their ISP handed them, which was often slow and often logging. Cloudflare's 1.1.1.1 and Google's 8.8.8.8 are the two well-known public alternatives, both consistently faster than a typical ISP resolver in published measurements. Treat any specific millisecond figure you read about them with suspicion, including in their own marketing: resolver depends heavily on where you are and how your traffic is routed, and the honest way to know is to measure from where your users actually are.

Quick Check

Knowledge Check

6 questions - Score 80% to pass

Q1

Your browser needs to visit github.com for the first time. What does DNS do?

Q2

You create a new A record for api.example.com. A colleague had already tried the name five minutes earlier and got an error. They still get 'does not exist' twenty minutes later, even though the record is definitely there. What is happening?

Q3

You want your bare domain example.com to point at myapp.vercel.app. Your DNS provider rejects the CNAME. Why?

Q4

In the 2021 Meta outage, what actually failed?

Q5

You need to fail over to a standby region within two seconds of a health check failing. Is DNS the right mechanism?

Q6

You run 'dig @198.41.0.4 example.com' and the reply has the 'ra' flag set. Why is that suspicious?

DNS holds more than addresses.
ChartFigure 6. The TTL you set last year is how long your cutover takes

Nothing switches at the moment you save the record. Caches switch when they expire, and they expire on the schedule the old TTL set.

The curves are idealised. Real caches expire at scattered times, so the real shape is smoother. The gaps between the three lines are the part that is true.

That figure contains the single most useful operational fact in this lesson, and it is counter-intuitive: lowering the TTL on the day of a migration does nothing. Resolvers are already holding your old TTL. They will not learn the new one until the old one expires. The lowering has to happen at least one old-TTL period before the change.

SequenceFigure 8. You created the record, and the resolver still says it does not exist

A resolver caches a negative answer for the same reason it caches a positive one, and the lifetime comes from the last field of the zone's SOA rather than from any record's own .

Nothing you do at the authoritative server shortens it, because during that window nothing asks the authoritative server anything.

The practical rule: create the DNS record before anything queries the name. Point your deployment at a hostname only after that hostname resolves. Once a resolver has cached the absence, you are waiting out the SOA minimum, and this is far and away the most common reason a correct DNS change appears not to have worked.

It is UDP until it is not

A sequence diagram with two lifelines: a resolver and an authoritative server that has a large answer. The resolver queries over UDP. The server replies with TC=1, truncated, noted as the answer not fitting in the original 512-byte limit. The resolver repeats the same query over TCP and receives the full answer, noted as two round trips instead of one. A final step shows the resolver advertising EDNS0 with a 1232-byte buffer to skip the fallback next time.
SequenceFigure 9. DNS is UDP until the answer gets too big

The original specification capped a UDP response at 512 bytes. Real zones outgrew that decades ago, especially once DNSSEC signatures started travelling with the answers.

EDNS0 lets a client advertise a larger buffer up front. You can see the negotiated size in dig's output, on the line reading udp: 1232.

This is why a firewall that blocks on port 53 breaks DNS intermittently rather than completely. Small answers work and large ones do not, so the bug appears to depend on which domain you asked for, because it does.

Recorded
Figure 11. Three root servers on three continents, and one machine answering for all of them

This was recorded on an ordinary home connection while writing this lesson. Every reply came back in single-digit milliseconds from a box on the local network.

Two things in it are impossible. A root server is authoritative-only and never sets the recursion-available flag. And a root server answers a query about .academy with a referral to the .academy operators, never with the root's own server list. All three replies do both wrong things, identically.

hostname.bind asks the responder to name itself, and it did. The same question over HTTPS, where nothing on the path can rewrite it, returns the correct delegation.

That is not a claim about the internet. It is one network, on one evening, and the point is that the check takes ten seconds and almost nobody runs it. Run it on yours before assuming yours is different.

DNSSEC: signatures, not secrecy

A chain diagram. The root's key, shipped with your resolver, leads to the root signing a hash of .com's key, which leads to the .com zone signing a hash of example.com's key, which leads to example.com signing its own A record, which leads to the resolver checking the whole chain and only then believing the answer.
FlowchartFigure 12. DNSSEC proves the answer was not changed, and hides nothing

The resolver ships with the root's public key, and that is the only thing it trusts outright. Every level signs a hash of the level below, which is what makes it a chain that can be checked all the way down.

A forged record fails verification, because the attacker cannot produce a valid signature without the zone's private key.

DNSSEC and DoH solve different halves of the same problem and neither replaces the other. DoH protects the query in transit and proves nothing about the answer. DNSSEC proves the answer and hides nothing. Adoption of DNSSEC is still partial, which means most resolvers cannot verify most domains and fall back to trusting what they are told.

ArchitectureFigure 15. The answer depends on who is asking, and that is how CDNs work

Nothing in DNS says a name must resolve to the same address for everybody. An authoritative server can look at where a query came from and answer differently.

So the DNS response becomes the routing decision, made before any connection opens at all.

There is an accuracy limit here worth knowing, because it produces real bugs. The authoritative server usually sees the resolver's address, not yours. A user on a distant public resolver can be routed to the wrong continent. The EDNS Client Subnet extension exists to pass along a truncated version of your address, and it is not universally enabled.

Redundancy almost nobody buys

A figure showing example.com publishing NS records from two operators at once. On the left, Cloudflare with ns1.cloudflare.com and ns2.cloudflare.com. On the right, Route 53 with ns-101.awsdns-12.com and ns-902.awsdns-49.net. A note explains that a resolver which cannot get an answer from one set simply tries the other and neither operator needs to know the other exists, and that the hard part is keeping two zones in step.
ArchitectureFigure 16. Two DNS providers, one domain, no single vendor can take you down

NS records are a list, and nothing requires every entry to belong to the same company. A resolver picks among them and moves on if one set does not answer.

An outage at one provider degrades to slightly slower lookups instead of to nothing at all.

If your entire business is reachable only through one DNS vendor, that vendor is a single point of failure that appears on none of your architecture diagrams. This is the fix, it costs two accounts and a way of publishing the same zone to both, and it is a weekend of work rather than a project.

Round robin is not load balancing

A sequence diagram with three lifelines: clients, DNS holding three A records, and Server B which just crashed. Clients ask where app.example.com is. DNS returns A, B, C and then on the next query B, C, A, noted as the order rotating being the whole mechanism. A client connects to Server B and fails. DNS is still handing out B, noted as DNS having no idea B is down and the record being cached anyway.
SequenceFigure 17. Rotating a list is not the same as knowing which server is up

The zone holds several A records and the server rotates the order it returns them. Clients usually try the first, so traffic spreads roughly across the list.

Nothing here is measuring load, and nothing is checking whether a server responds. A cached answer keeps pointing at a dead server until its expires.

Use it for coarse spreading, never for availability. Real DNS failover needs health checks and a short TTL, which is a feature of your DNS product rather than a property of DNS itself, and even then your recovery time is floored by the TTL.

after “DNS as Infrastructure, Not Just Lookup”

Stuck on how this part actually works?

The System Design course gives this its own lesson: Anycast Routing.

Plain English first, then the detail, then a quick check that you got it.

See what the course covers
Figure 19. Their servers never went down. Nobody could find them.

In October 2016 a DDoS from a botnet of compromised cameras, DVRs and routers running the Mirai malware hit Dyn, a major DNS provider. Reported peak traffic figures were around a terabit per second, and the exact number was never independently confirmed.

Not one of those companies had a server problem that day. Their uptime dashboards stayed green, because the servers really were up.

That outage is the reason multi-provider DNS became a normal practice at large companies, and it is worth noticing that the two headline DNS outages in this lesson had nothing in common. Meta's was self-inflicted and their own DNS behaved correctly. Dyn's was external and their DNS could not respond at all. The only thing shared is which layer the users experienced it at.

FigureFigure 21. Five symptoms that cover most of the DNS problems you will meet

The first row is the most common and the least known, which is an unfortunate combination.

The third row is really an instruction rather than a diagnosis: always compare more than one resolver before concluding anything.

One habit is worth more than the whole table. Before changing anything, query the authoritative server directly and compare it with what a public resolver returns. If they agree, your record is wrong. If they differ, your record is right and you are waiting on a cache, and no further change will help.

after “What DNS Costs You on Every First Visit”

An interviewer will ask why, not only what.

The lesson that covers it: Traffic Mirroring, in the System Design course.

26 minutes, drawn step by step, so you can sketch it yourself afterwards.

Open the System Design course page $49 once, lifetime access