Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
DNS and Content Delivery Networks  ›  Lesson

The Domain Name System

Domain Name System 15 minDNS turns a name like hop.example into an IP address through a chain of servers, and every answer is cached for its time-to-live, which trades speed against how quickly changes spread.

The Domain Name System

Nobody types 203.0.113.40 to open a link; they type hop.example. Computers, however, connect to numbers. The Domain Name System (DNS) is the internet's phone book that turns one into the other — and it is the first step of every single request Hop receives.

The rule

Ask down the chain once, then trust the cache until TTL.

When a browser needs hop.example, it checks its own cache, then the operating system's. If neither knows, it asks a recursive resolver (usually run by the internet provider or a public service), which walks the chain for it:

  1. Root servers — "for .example, ask these servers".
  2. TLD servers for .example — "for hop.example, ask Hop's name servers".
  3. Authoritative name servers for hop.example — "it is 203.0.113.40".

Each answer carries a TTL (time to live) in seconds. Every cache along the way keeps the answer until the TTL runs out, so the next visitor skips the whole walk.

Common record types:

Record Maps a name to
A an IPv4 address
AAAA an IPv6 address
CNAME another name (an alias)
NS the name servers for the domain
MX the mail servers for the domain

Managed DNS services can also do routing: return different addresses by weight (send 10% to a new server), by the user's location, or only to servers that pass health checks.

The shortcut

Every TTL is a trade: long TTL = fast lookups, slow changes; short TTL = quick changes, more lookups. Before any change of address, shrink the TTL first.

Moving Hop to a new serverStep 1 of 4
  1. See the problem

    The A record has a TTL of one day. Change it now and some users hit the old server for up to 24 hours.

The trap is forgetting that you control only your authoritative servers. Caches around the world keep old answers until the TTL they were given runs out — you cannot flush them.

Drills

Answer fast — trust the rule.

quick drill

Which record maps hop.example to an IPv4 address?

quick drill

Which server gives the final, official answer for hop.example?

quick drill

What does a record's TTL control?

quick drill

You must change Hop's IP address next week. What should you do first?

quick drill

Which record would make go.hop.example an alias of hop.example?

Remember

  • Ask down the chain once — root, TLD, authoritative — then trust the cache until TTL.
  • Shortcut: long TTL = fast lookups, slow changes; shrink it before any move.
  • Trap: you cannot flush other people's caches; they keep old answers until the TTL runs out.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainPlan Hop's server move

Hop is moving to a new server with a new IP address next Tuesday. Its A record currently has a TTL of 86,400 seconds (one day). Explain how DNS caching affects the move, and give a step-by-step plan that lets most users reach the new server within minutes of the switch.