Skip to content
Optimal Lab

Networking · interactive

DNS resolution, hop by hop

Before your browser can connect to api.shop.example, it needs an IP address. Nobody holds the whole phone book: the answer is found by asking a chain of servers, each pointing to the next. Caches skip most of the chain.

Looking up api.shop.example

0 ms so far

  1. Browser cachelocal

    → not cached

  2. Operating systemlocal

  3. Recursive resolver (your ISP or 1.1.1.1)+8 ms

  4. Root server+25 ms

  5. .example TLD server+30 ms

  6. ns1.shop.example (authoritative)+40 ms

Browser cache: not cached

Resolver cache

total 103 ms

Step 1 of 4

  1. 1

    Check the local caches

    The browser and the operating system remember recent answers until their TTL runs out.

    Here neither has it.

  2. 2

    Ask a recursive resolver

    Your ISP's resolver, or a public one like 1.1.1.1, does the legwork. It caches answers for everyone who uses it.

    Cold: it has to go find out.

  3. 3

    Root, then TLD, then the domain's own servers

    The root knows who runs .example. The .example servers know who runs shop.example. Only shop.example's servers know the actual address.

    Three more round trips.

  4. 4

    The TTL decides how long it's cached

    A 300-second TTL means changes take up to five minutes to reach everyone. Lower it before a migration; raise it for speed.

    cold 103 ms · warm 8 ms

In production

Tools and technologies

Every connection starts with a lookup like this one.

Not tied to one language — use these names when you search docs or design a system.