5 min
  • DNS
  • Caching

Finding a website's address

How does your computer find the number behind a website's name?

A name such as www.example.com is a domain name. People can remember it. But packets can only be sent to a number: the site's IP address.

Turning the name into the number is the job of DNS. Your computer doesn't do the searching itself. It asks a resolver, which works like a helper who looks up numbers for you.

No single server holds every name. So a resolver that knows nothing yet has to ask in steps.

  1. A root server says which servers look after names ending in .com.
  2. A .com server says which servers look after example.com.
  3. Those servers hold the real answer, and give the resolver the number.

Press play to watch a resolver with nothing written down find the number from scratch.

Loading the DNS Explorer simulation…

Three questions for one name takes time. So the resolver writes each answer down to reuse it, and the saved answers are called a cache. The next time anyone asks for example.com, the resolver answers straight away, without asking anyone else. Each answer says how long it may be kept, so old answers don't linger forever.

The run ends with a second question about the same site. Its answer is too big for one small packet. So the resolver asks again, in a way that can carry more.

Check yourself
Nobody using this resolver has visited example.com before. Who gives the resolver the site's number?

Key takeaways

  • Packets are sent to IP addresses, so a website’s name has to be turned into a number first. That is what DNS does.
  • A resolver finds the number by asking in steps: a root server, a .com server, then the site’s own servers.
  • The resolver keeps answers in a cache, so the next lookup for the same name is almost instant.

Take it further