Labs / Speaking Protocols / TCP, UDP & DNS

Lab 2 of 3 · TCP, UDP & DNS

The DNS tree: how a name is found

Follow a resolver down the DNS hierarchy, from the root to an answer.

Open this lab Pro 6 steps

The idea

The laptop asks one DNS server, the resolver, for a name. The resolver finds it by walking a tree of servers on the internet (rootServer, labServer, exampleServer), then remembers the answer.

Root, then lab, then example.lab
Root, then lab, then example.lab
A referral carries the next server's address
A referral carries the next server's address

Steps

  1. Ask the resolver

    A name like www.example.lab is for people; packets need an IP address, so the laptop asks a DNS server to turn one into the other. Ask the laptop's DNS server for www.example.lab and read the whole reply, from its flags to who answered.

    laptop:~# dig www.example.lab
  2. The resolver walks the tree

    No server knows every name, so the resolver asks several, from the top of the tree down. Ask again while it records its traffic, and count who it asks. Then the lab makes rootServer drop every DNS question, and the same lookup runs once more.

    laptop:~# dig +short www.example.lab
    laptop:~# dig +tries=1 www.example.lab

Pro

4 more steps in the app

  1. Walk it by hand
  2. The cache, and the TTL
  3. Aliases: CNAME
  4. No such name
Get Pro

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab