The System Design Newsletter

The System Design Newsletter

How DNS Works 🔥

#70: Distributed Hierarchical Database for 5.35B Users (2 Minutes)

Neo Kim's avatar
Neo Kim
May 02, 2025

Get my system design playbook for FREE on newsletter signup:


This post outlines how DNS works. You will find references at the bottom of this page if you want to go deeper.

  • Share this post & I'll send you some rewards for the referrals.

Once upon a time, the internet was a quiet place with only a tiny number of sites.

Each server was assigned a unique number, called the Internet Protocol (IP) address.

It lets users reach the server via efficient routing over the network.

What Is a DNS Server and How Does It Work

Yet it became difficult for users to remember each site’s IP address.

So they created a text file to map site names to IP addresses.

Although it temporarily solved their naming problem, it became extremely difficult to scale because the number of sites exploded.

So they set up a hierarchical distributed database called the Domain Name System (DNS).

Onward.


What Is a DNS Server and How Does It Work

Think of DNS as a phone book; it returns the IP address on a site name lookup.

Let’s dive in!

The browser checks its cache for the IP address when the user enters a site name.

Browser Checking Its Cache for IP Address
Browser Checking Its Cache for IP Address

The browser then queries the operating system’s cache to check if it has the site's IP address.

Operating System Checking Its Cache for IP Address
Operating System Checking Its Cache for IP Address

If not, the browser sends a request to the resolver server to find the IP address.

Think of the resolver server as a component to find the correct DNS server for a site name.

The Internet Service Provider (ISP) maintains the resolver server, and it checks its cache for the IP address.

Browser Querying the Resolver Server for Correct DNS Server
Browser Querying the Resolver Server for the Correct DNS Server

The resolver server then sends a query to the closest root server. There are 13 root servers across the world.

Resolver Server Querying the Root Server to Find Right TLD Server
Resolver Server Querying the Root Server to Find the Right TLD Server

Yet a root server doesn’t store the IP address.

Instead, it forwards the query to the correct top-level domain (TLD) server, such as .com or .org.

Imagine the root server as a DNS component to find the right TLD server.

Resolver Server Querying the TLD Server to Find Authoritative Name Server
Resolver Server Querying the TLD Server to Find the Authoritative Name Server

But TLD doesn’t store IP addresses either.

Instead, it routes the query to the correct authoritative name server.

The authoritative name server contains the IP address; it responds to the resolver server.

The Authoritative Name Server Returns IP Address
The Authoritative Name Server Returns IP Address

The resolver then returns the IP address to the browser. While the browser queries the site’s web server directly to access it.


TL;DR:

Subscribe for free to continue reading

Enter your email and get every post from The System Design Newsletter.
Already have an account? Sign in
© 2026 Neo Kim · Publisher Privacy
Substack · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture