Science / Grade 8
When a name answer expires
Learning goal: Compare a DNS source record with a cached answer, calculate expiry and keep page-service availability separate.
Before you start: Add and subtract whole-number times on one clock. Distinguish a name from its address and a page service. Use only supplied fictional records; the source is always available and other resolver policies are excluded.
Read or print this lesson What to practiceThe video could not load. The transcript is still available below.
Next: your worksheet
DNS Cache Lifetimes - Observatory Records
Checking sign-in...
Read the transcript
Saved reading place
Video transcript and practice. Reading or printing does not count as playback time or an assessed grade.
1. A name answer is not a page
Video: 0:00

Our pretend observatory wants the Atlas page, but its name answer still points to Mirror. We will separate three things: the source record, a saved copy of its answer, and the page request made using that address. The domain name system, or D N S, helps look up information about names. It does not promise that a page service works. All addresses in this lesson begin with one ninety-eight, fifty-one, one hundred. Atlas ends in forty. Mirror ends in forty-one. Do not contact or configure these example addresses.
2. Give the copy an expiry
Video: 0:41

At model second ten, our resolver obtains the address ending in forty-one and keeps a copy. The answer has a time to live of forty seconds, usually called T T L. Add the time obtained and its lifetime: ten plus forty is fifty. In this simplified model the copy may answer requests before second fifty. At second fifty it has expired. The next lookup must ask our always-available source again. Forty seconds is the lifetime, not the clock reading at expiry.
3. The source changes first
Video: 1:18

At second twenty, someone corrects the source record to Atlas, ending in forty. This source is called authoritative for the name. Our resolver still has its earlier copy ending in forty-one. Changing the source does not reach into that already-saved copy and rewrite it. Keep two columns: what the source says now, and what this resolver remembers. The cache did not receive a tiny messenger shouting, new address! It has its own remaining lifetime, and we must check that before choosing an answer.
4. A hit does not restart the clock
Video: 1:55

Now a request arrives at second thirty-five. The saved copy expires at fifty, leaving fifteen seconds. The resolver uses its cached address ending in forty-one, so this request goes toward Mirror. That is a cache hit. Reading the copy does not restart its forty-second lifetime. Another request at second thirty-five still leaves fifteen seconds, not forty. A reachable wrong page does not mean the route was broken. Here the address answer selected a different service from the one we wanted.
5. Refresh on the next expired lookup
Video: 2:33

At second fifty, the old copy has no time left. A lookup at that moment asks the source again. It now obtains Atlas, ending in forty, with another forty-second lifetime. This new copy expires at ninety. Notice that expiry by itself did not send a background lookup in our model: the request at fifty triggered the refresh. Waiting without correcting the source would only obtain the wrong address again. Real resolvers have more policies; this exercise has one cache, no prefetching and an always-available source.
6. Correct address, stopped service
Video: 3:13

Suppose the new address correctly reaches Atlas, but its page service is stopped. The address lookup worked; the page did not. Start the pretend service, then make another page request. It can now succeed with the same address and the same expiry time. You did not need to wait for D N S to forget a correct answer. A D N S cache stores naming information. A browser or content delivery network may separately cache page content. Those are different copies, not one universal refresh button.
7. Pause: read a fresh record
Video: 3:51

Pause for a different record. A resolver obtains the old address ending in forty-one at second two hundred, with a lifetime of fifteen seconds. The source changes to Atlas, ending in forty, at second two hundred four. No other lookup happens until the requests we are about to test. Which address is used at second two hundred fourteen? Which is used at second two hundred fifteen? If a new copy is obtained then with the same fifteen-second lifetime, when does it expire? Write the expiry calculation first, then explain the two requests.
8. Check the boundary exactly
Video: 4:32

Two hundred plus fifteen gives an expiry of two hundred fifteen. At two hundred fourteen, one second remains, so the old address ending in forty-one is used. That hit does not extend the expiry. At two hundred fifteen, the copy has expired. The lookup obtains the corrected address ending in forty and a new fifteen-second lifetime. Two hundred fifteen plus fifteen is two hundred thirty. This answers the naming question only. Whether Atlas returns a page still depends on the route and the page service in the supplied records.
9. Fun fact: copies can disagree
Video: 5:14

Fun fact: two resolvers can hold copies of the same answer with different time left. If one obtains a twenty-second copy at second seven, its expiry is twenty-seven. Another obtains one at twelve; its expiry is thirty-two. At twenty-seven, one has expired while the other has five seconds left. Different observations need not mean someone changed the source twice. Real D N S includes additional behavior, including policies for unavailable sources. Our always-available-source model leaves that out and does not diagnose your device or our website.
10. Continue to the worksheets
Video: 5:57

Continue to the first worksheet and read its new times, not the totals from this video. Mark when the copy was obtained, add the stated lifetime, and compare each request with the expiry. Keep the current source and cached answer separate. Then try the second worksheet, which has another set of records. Finally, investigate the last two repairs in Network Workshop using its model clock. Explain why a lookup succeeds or fails separately from the page service. Watching and guided play support learning, but your independent practice provides different evidence.
Show your understanding
You can point, explain aloud, draw or write.
- Calculate a cached answer's expiry and remaining lifetime without renewing it on a hit.
- Choose between an unexpired copy and the current source at expiry, then explain page availability separately.
Try it yourself
Pause at the fresh 200/15 record. Explain the answers at 214 and 215, then calculate the refreshed copy's expiry.
Continue to both worksheets, then Network Workshop repairs 13-14. Use each new set of times; no real network access is needed.
Next: your worksheet
DNS Cache Lifetimes - Observatory Recordshttps://s3u.com/sn8d1
Practice Two: another cache log · Practice cache lifetimes and page availability · Investigate in Network Workshop
Lesson: https://s3u.com/lessons/when-a-name-answer-expires