MobDojoStart learning free

Mobile Networking · How Apps Talk · Lesson 2 of 4

DNS: The Internet's Phone Book

Follow a DNS lookup from your phone to the server that knows the answer.

12 min60 XPFree lab

Following a DNS Lookup

Computers find each other by IP address, but people remember names like example.com. The Domain Name System, or DNS, turns names into addresses. When an app connects to a server by name, a DNS lookup usually happens first.

Your phone hands the job to a recursive resolver, usually run by your ISP, your mobile carrier, or the Wi-Fi network you're on. If the resolver doesn't already know the answer, it works down a chain. It asks a root server, which points it to the servers for the top-level domain, like .com. Those point it to the domain's authoritative server, which holds the real answer.

Each answer comes with a TTL, short for time to live. It's the number of seconds the resolver may keep the answer in its cache. Until the TTL runs out, repeat lookups are answered straight from the cache, which is much faster.

On the simulated phone, pick a domain and watch the lookup travel from server to server. Note the TTL in the answer. Then look up the same name again and see where the answer comes from.

Records and Who Sees Your Lookups

DNS stores different kinds of information in records, and each record has a type. The A record holds an IPv4 address. The AAAA record holds an IPv6 address, which is longer. A CNAME record says one name is an alias for another. An MX record says which server accepts email for a domain.

Root servers sit at the top of the system. There are 13 named root server identities, labeled A to M, run by 12 independent organizations. Each one is copied to many sites around the world, so in practice there are well over a thousand root server instances.

DNS matters for privacy. Traditional DNS queries travel unencrypted, so the resolver and anyone on the network path can see every name your phone looks up. Even when a page itself is encrypted, the site's name often leaks through DNS. Network admins and investigators use DNS logs to see which services a device contacted. Course 5 covers encrypted DNS, which hides lookups from the local network.

Hands-on lab

Try it on the simulated phone

Look up a name and watch the question travel from resolver to root to TLD to the authoritative server, then come back from cache.

Open the lab
Test yourself

Can you answer these?

  1. When you look up the same name a second time, where does the answer come from?
  2. Which DNS record type holds an IPv4 address? Give its one-letter name.

Answer them in the app to earn 60 XP.

Answer in the app