Lesson 2 of 6

Find the website’s address

In the first lesson, the browser already knew where to send GET /guide. Now start with only the name trailnotes.example. DNS is the system that maps that name to an address the browser can connect to.

  1. Browser
  2. Recursive resolver
  3. Authoritative DNS
The resolver returns a cached address or follows referrals on a miss. The browser then connects to the site.

The browser or operating system can reuse an answer it already has. Otherwise, it asks a recursive resolver. On a cache miss, the resolver follows referrals as needed to reach the authoritative DNS server, which publishes the site's record. The resolver returns the address, and the browser uses it for the HTTPS connection. The HTTP request itself travels to the site.

Predict. In this exercise, a resolver caches 192.0.2.10 at 09:00:00 with a 60-second TTL. The TTL sets how long the answer can be reused in this model. The site owner publishes 192.0.2.20 at 09:00:15. Which address does that resolver return at 09:00:30? What does it return on its first new lookup at 09:01:01?

Reveal the answer

At 09:00:30, the cached answer still has 30 seconds left, so it returns 192.0.2.10. At 09:01:01, the old entry has expired. Assuming the resolver can query the authoritative server and receives the new record, it returns 192.0.2.20. Other resolvers may have cached their answers at different times.

Try the DNS cache lab