Free sample lesson · DNS 完全指南:解析原理、流量控制與效能優化

解析鏈與多層快取:browser → OS → resolver → root → TLD → authoritative

Lesson 1 of the Wondering course DNS 完全指南:解析原理、流量控制與效能優化

The Hidden Chain Behind One Click

You type a name. The page loads in milliseconds.

Between those two moments, a name has to become an address. That work passes through several layers, each one able to answer on its own.

The chain runs browser, operating system, resolver, root, TLD, then authoritative server.

The resolution chain in order
  • Browser: The browser checks its own name records first.
  • Operating system: The OS answers from its own local store of names.
  • Resolver: The recursive resolver takes over the lookup on your behalf.
  • Root and TLD: Root and TLD servers point the resolver toward the right zone.
  • Authoritative: The authoritative server holds the real answer for the domain.

Most requests never reach the end of that chain.

Layer One: The Browser

The first stop is the closest one. Your browser keeps its own small store of recently resolved names.

If the name is there, resolution ends immediately. No network request leaves the machine.

This is why the second visit to a site often feels faster than the first.

What happens at the browser layer
  • Name found
  • Name missing

The browser is a layer of the chain, and also the first chance to skip the rest of it.

Layer Two: The Operating System

If the browser has nothing, the query moves to the operating system.

The OS keeps its own store of names, shared by every application on the machine. A name resolved by one program can serve another.

Still no traffic on the network.

Where each layer lives
  • Authoritative server: Holds the real answer for the domain.
  • Root and TLD: Point the resolver toward the right zone.
  • Recursive resolver: Does the lookup on your behalf, outside your device.
  • Operating system: Shared by every application on the machine.
  • Browser: The closest layer and the first chance to answer.

The two innermost layers live entirely on your own device.

Two layers have now had a chance to answer, and both live entirely on your own device.

Layer Three: The Resolver

Now the query leaves your machine and reaches a recursive resolver.

The resolver does the lookup for you. It also serves many users at once, so it has seen popular names many times already.

That shared traffic is what makes the resolver so effective. A name requested by one user can answer the next.

The resolver's decision
  • Query arrives: The query leaves your machine and reaches a recursive resolver.
  • Name already seen?: The resolver serves many users, so it has seen popular names many times.
  • Answer the user: The query travels no further.
  • Continue the chain: The resolver carries on toward root and TLD servers.
  • Yes
  • No
  • Returns answer

Because of this, the resolver stops a very large share of queries before they travel any further.

Root, TLD, Authoritative

Only unanswered queries get this far.

The root server does not know your address. It points toward the right top-level domain, such as .com.

The TLD server does not know it either. It points toward the domain's authoritative server.

Three layers, three different jobs
  • Root
  • TLD
  • Authoritative

The authoritative server is the only layer holding the real answer. Everything above it is a referral.

Why The End Is Rarely Reached

Each layer that can answer is a layer that removes work from the one below it.

The browser filters first. The operating system filters next. The resolver filters the largest share, because its traffic is shared across many users.

By the time a query reaches root, TLD, and the authoritative server, it has survived every earlier filter.

Why is the true answer asked least?

That is why the vast majority of requests never touch an authoritative server.

What To Take Away

DNS is not one lookup. It is a chain of layers, each able to end the query early.

Two layers sit on your device. One sits with your provider. Three sit out on the wider internet.

Speed comes from how rarely the full chain runs.

Layer, location, role

When you debug a name problem, ask which layer answered, not just what the answer was.

Check yourself

Both the browser cache and the operating-system cache can answer a name query without sending network traffic.

  • True
  • False

Answer: True

Correct. These are the two local layers. If either has the name, resolution ends before the query leaves the device.

A DNS query's resolution chain begins at the _____, moves to the _____, and then reaches the _____. If still unanswered, it proceeds to the _____, then the _____, and finally the _____.

Answer: A DNS query's resolution chain begins at the browser, moves to the operating system, and then reaches the resolver. If still unanswered, it proceeds to the root, then the TLD, and finally the authoritative server.

The chain moves from the closest cache to progressively more distant services. The authoritative server is reached only if every earlier layer failed to answer.

Why can a recursive resolver stop many users' DNS queries before they reach the root server?

  • It stores shared results from requests made by many users
  • It is the only layer that knows every domain's address
  • It sends every query directly to the authoritative server
  • It replaces the browser and operating-system caches

Answer: It stores shared results from requests made by many users

A recursive resolver serves many users and keeps shared results. A name looked up by one user may already be available when another user requests it.

Keep going

This is lesson 1 of 7 in DNS 完全指南:解析原理、流量控制與效能優化. Next up:

  1. Lookup 延遲與隱藏的效能成本
  2. Round-robin DNS 與 GeoDNS
  3. Weighted 與 latency-based routing(以 Route 53 為例)
  4. TTL 的取捨與 DR 演練實務
  5. Cache poisoning 與 DNS spoofing

Start this course free

Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.