Skip to content

Lesson 2 of 3

How DNS resolution works

2 min

DNS (Domain Name System) is the internet's phone book. When you type a domain, your device needs its IP address before it can connect.

The lookup, step by step

  1. Your device asks a recursive resolver, usually run by your ISP or a public service such as 1.1.1.1 or 8.8.8.8.
  2. If the resolver doesn't already know the answer, it asks a root server, which points it to the servers for the TLD (for example .com).
  3. The TLD servers point it to the domain's authoritative nameservers, the ones listed at your registrar.
  4. The authoritative server returns the actual record, for example the A record with the IP address.
  5. The resolver hands the answer back to your device and caches it.

TTL and caching

Every record has a TTL (time to live) in seconds. Resolvers keep the answer for that long before asking again. This is why DNS changes don't appear everywhere at once: some resolvers still hold the old answer until its TTL runs out.

Planning a migration? Lower the TTL to 300 seconds a day before the move, then raise it again afterwards.

Try it yourself

dig insidx.com
dig +trace insidx.com

The first shows the answer; the second walks the whole chain from the root servers down.