Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Network Devices and Services  ›  Lesson

DNS — Names to Addresses

DNS 15 minDNS turns names into IP addresses by asking from the root down to the authoritative server, and caches each answer for its time to live.

DNS — Names to Addresses

One Monday nobody at Kite Studio can open any website, yet ping 198.51.100.25 works perfectly. The network is fine; the name lookups are failing. DNS is so invisible when it works that people forget every single visit to a website begins with it.

The rule

DNS asks from the top down, then remembers the answer for a while.

The job. DNS (Domain Name System) turns names people remember, like shop.example.com, into IP addresses routers can use. It is a worldwide, distributed directory: no single server holds every name.

The hierarchy. Names are read right to left. At the top are the root servers. They know who runs each top-level domain such as .com or .in. The .com servers know which authoritative server holds the records for example.com. That authoritative server gives the final answer for shop.example.com.

The resolver. Asha's laptop does not walk that tree itself. It asks one recursive resolver — run by the ISP, by the office, or a public service — and the resolver does the walking. Well-known public resolvers include Cloudflare (1.1.1.1), Google (8.8.8.8), Quad9 (9.9.9.9, which also blocks known malicious domains) and OpenDNS (208.67.222.222, with optional content filtering).

Caching. Every answer comes with a TTL (time to live) in seconds. The resolver and the laptop keep the answer until the TTL runs out, so the next lookup is instant.

Record types to know: A (name → IPv4 address), AAAA (name → IPv6 address), CNAME (this name is an alias of another name), MX (which server receives email for the domain), NS (which servers are authoritative) and TXT (free text, often used for verification). DNS queries normally use UDP port 53, falling back to TCP for large answers.

The shortcut

When a name will not resolve, walk the chain in order: laptop cache → resolver → root → TLD → authoritative. And when a changed record still shows the old address, suspect a cache holding it until the TTL expires.

First lookup of `shop.example.com` of the dayStep 1 of 4
  1. Ask the resolver

    Asha's laptop has nothing cached, so it asks the resolver the office uses.

The trap is blaming "the internet" when only DNS is broken. If an IP address works but the name does not, the problem is name resolution.

Drills

Answer fast — trust the rule.

quick drill

Which record type maps a name to an IPv6 address?

quick drill

In a first-time lookup, who does the walking from root to authoritative server?

quick drill

The studio moved its website to a new server, but some people still reach the old one for a while. Most likely cause?

quick drill

Which DNS record says where email for example.com should be delivered?

quick drill

ping 198.51.100.25 works but ping shop.example.com fails. What is broken?

Remember

  • DNS asks from the top down (root → TLD → authoritative), then caches for the TTL.
  • A = IPv4, AAAA = IPv6, CNAME = alias, MX = mail, NS = authority; queries use port 53.
  • If the IP works and the name does not, it is DNS.

Practice — level up

0/1 solved

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

ExplainDiagnose the DNS outage

Nobody at Kite Studio can open websites by name, but ping to an IP address works. Explain what that tells you, how a normal first lookup of shop.example.com works, and why a recently changed record might still show an old address.