Vol. I · No. 46The protocol sectionSat, 10 Oct 2026
Layer 7 · Naming · the phone book of the internet

DNS

Domain Name System

DNS is the internet’s directory. People type names; machines route to numbers — DNS translates a name like example.com into the IP address a packet can actually reach. It is a distributed, hierarchical database that answers billions of lookups a second, almost always over a single small UDP exchange.

DNS turns a name you can read into an address a packet can reach — then caches the answer so it needn’t ask again.

You can run this one

Open the DNS lab →

Turning a name into an address: four questions, three referrals, one answer—then a warm cache that asks nobody.

Intermediate
Operates at
Layer 7
an application service
Port
53
UDP, TCP for large
Shape
Hierarchical tree
root → TLD → zone
Speed trick
Caching
answers carry a TTL

How it works

Resolving www.example.com — the recursive walk
Your device
stub resolver asks “where is example.com?”
Recursive resolver
does the legwork & caches
If not already cached, the resolver walks the tree from the top…
Root server
“Ask the .com servers” — a referral, not the answer
.com TLD server
“Ask example.com’s authoritative server”
Authoritative
“A record → 93.184.216.34” — the real answer
Answer + TTL cached
next lookup is instant
Resolver returns 93.184.216.34
your device connects

Each level hands back a referral until the authoritative server gives the record. Every answer carries a TTL, so the whole walk usually happens once and then is served from cache.

The main points

What DNS does, step by step

1
Ask the resolver

Your device sends one small UDP query to a recursive resolver — often your ISP’s or a public one.

2
Walk the hierarchy

On a miss the resolver asks root, then the TLD, then the authoritative server — each a referral downward.

3
Return the record

The authoritative server answers with the record type asked for — an A or AAAA address, an MX, a CNAME.

4
Cache by TTL

Every layer stores the answer for its time-to-live, so repeat lookups skip the walk entirely.

Common record types
A / AAAA — name → IPv4 / IPv6
CNAME — an alias to another name
MX — where mail is delivered
NS — a zone’s name servers
TXT — free text: SPF, verification
PTR — reverse: IP → name

In cybersecurity

DNS is early in almost every connection and was designed with no authentication, which makes it both a prime target and a favourite covert channel.

Cache poisoning

A forged reply slips a wrong address into a resolver’s cache, sending everyone to the attacker’s host.

DNSSEC

Signs records with a chain of trust from the root, so a resolver can detect tampering.

DoH & DoT

DNS over HTTPS/TLS encrypts the query itself, hiding which sites you look up from the network.

DDoS amplification

A tiny spoofed query provokes a large reply aimed at the victim — open resolvers make it worse.

DNS tunnelling

Malware hides data inside seemingly innocent lookups to smuggle it past a firewall.

Domain hijacking

Stolen registrar credentials repoint a whole domain; registry locks and MFA are the defence.

Rides in the stack

IPUDPDNS

Nearly always a single UDP datagram on port 53; queries too large for one packet fall back to TCP.

Works with

DHCPmDNSUDP

See it on Linux

hostnamenmclidigresolvectlnslookuphostsscurlwget

Anatomy & ports

The name tree
.root
.comTLD
examplezone
wwwhost
Ports
53/udpqueries
53/tcplarge · zone
853DoT
443DoH