- Home
- Courses
- Edexcel International A-Level Computer Science
- Protocols, Routing and DNS
- DNS Hierarchy, Resolvers and Caching
DNS Hierarchy, Resolvers and Caching
Trace a lookup through the resolver and the DNS hierarchy. Explain what a cached record saves and why changing an address does not instantly erase every previously cached answer.
Before you start
- Distinguish a client, recursive resolver, referral and authoritative answer.
- Calculate expiry from receipt time and remaining TTL under a supplied cache model.
Watch, pause, try
Video by Craig'n'Dave. Focus on the shared OCR explanation’s DNS discussion, then follow Pearson’s written resolver/hierarchy diagram. The primary terminology reference clarifies caching and authoritative roles. The exercises supply an ordinary TTL model and explicit sequential timing; resolution is separate from TCP/TLS establishment and application trust.
Viewing focus: Distinguish client, recursive resolver and authoritative servers
After watching, attempt these questions before opening the answers. You can also use the written lesson below.
After watching 1: A resolver receives an address record at time 10 s with TTL 120 s. The authority changes the record at time 40 s. May the original cached entry answer a query at 100 s, and may that same ordinary entry still be reused at 131 s without refresh? State its remaining TTL at 100.
Show answer and reasoning
The stipulated expiry is time 130. At time 100 the entry has 30 seconds left and can still supply the older cached value under this model; an authoritative change does not retroactively erase every cached copy. At 131 that entry has expired and cannot simply be reused under the ordinary model. Obtaining refreshed information still depends on the actual resolution/failure policy.
After watching 2: For one simplified cache miss, a resolver sequentially obtains a root referral in 8 ms, TLD referral in 12 ms and authoritative answer in 20 ms. Client-to-resolver round-trip delivery adds 2 ms; ignore all other work. Compare total with a usable local resolver cache hit and explain why a root reply need not contain the final address.
Show answer and reasoning
The supplied miss cost is 8+12+20+2=42 ms; the usable cache hit needs only the stipulated 2 ms client/resolver round trip. The root referral identifies where to continue rather than containing every domain’s final address. Cached intermediate information and different paths can change real costs; these are model values, not measured universal DNS latencies or proof of service trust.
What you'll be able to do
- Distinguish client, recursive resolver and authoritative servers
- Trace referrals through a simplified hierarchy
- Explain TTL-based caching and common DNS misconceptions
Assign the participants different roles
DNS associates names with typed resource records in a distributed hierarchical namespace. An address lookup can request an A record for IPv4 or AAAA for IPv6; not every DNS record is an address. A domain can have multiple records, and several names can refer to related services. A name is not an immutable numerical address baked into a web page forever.
A client commonly asks a recursive resolver to obtain an answer. That resolver may already hold a usable cached record. Otherwise it follows the hierarchy using referrals, contacting suitable root, top-level-domain and authoritative servers as necessary. A root server is not a database containing every website’s current address, and the client does not necessarily contact every hierarchy level itself for each query.
Draw a cache-miss lookup
For a simplified uncached lookup of lab.example, the resolver asks a root server where to find servers for the relevant top-level domain. It then asks a suitable TLD server for the authoritative server for the domain, and asks that authority for the requested record. The answer returns through the resolver to the client. lab.example is a teaching name; the diagram describes roles rather than a live public lookup.
A referral provides information about where to continue, rather than necessarily providing the final requested address. Actual systems can cache intermediate information, follow aliases and handle failures, so a complete successful lookup need not repeat every step in the simplified diagram. Keep question arrows and answer/referral arrows distinct and label the participant answering at each stage.
Explain freshness without promising instant updates
A time-to-live (TTL) limits how long a record can be reused from a cache under the ordinary model. If a resolver caches a record at time 0 with TTL 300 seconds, it can reuse it while that entry remains valid; an authoritative update at time 100 does not retroactively erase that cached copy. A later lookup after expiry normally needs refreshed information.
Caching reduces repeated work, latency and load, but can delay observation of a changed record. DNS resolution is also distinct from establishing a TCP/TLS connection and downloading a resource. Getting an address does not prove the service is reachable or trustworthy. Plain DNS by itself should not be described as automatically encrypting every query or proving that the returned application content is safe.
| Participant | Simplified cache-miss role |
|---|---|
| Client | Requests a record from a recursive resolver |
| Recursive resolver | Obtains/caches a usable answer |
| Root server | Refers towards the relevant TLD |
| TLD server | Refers towards the domain authority |
| Authoritative server | Answers for the relevant authoritative data |
Work through the problem
Attempt the task before opening its worked response. Record each change of state, explain the rule used, and check the result against the original requirements. Code examples labelled Python 3 use that language’s conventions; pseudocode states its own assumptions.
Example 1A resolver caches an address at time 0 with TTL 300 s. The authority changes it at time 100. Must a query at time 150 see the new address?
Example 2A learner draws the root server returning every website’s final IP address. Correct the role.
Common mistakes to avoid
Key takeaways
- DNS distributes typed records through a hierarchy.
- Resolvers use referrals and caches to obtain answers.
- TTL affects freshness; resolution is not a guarantee of application trust.
Explore further
- Pearson YCP01 official specification (opens in a new tab)
Check the International A-level requirements and relevant numbered points; this course remains in progress.
- Pearson International Computer Science subject guide (opens in a new tab)
Official introduction to the four examined units and their theory/practical purposes.
- Topic reading and reference (opens in a new tab)
Use the relevant board requirement or primary technical reference alongside the written examples.
- 58. OCR A Level (H046-H446) SLR11 - 1.3 TCP IP, DNS & protocol layers — Craig'n'Dave (opens in a new tab)
Original publisher or creator source for the embedded explanation; apply the stated viewing scope.
Return to this tomorrow
Close the notes and answer from memory. Revisit any explanation you cannot yet reconstruct.
- An authoritative update instantly deletes all cached old copies everywhere:
- Successful name resolution proves the service’s application content is safe:
Test yourself
Answer a few questions, then review anything you missed.
Keep practising
Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.