01Why DNS?
Computers communicate with IP addresses (192.0.2.1); humans remember names (google.com). DNS is the phonebook of the Internet. It meets three needs:
Name resolution
Map a hostname to an IP address.
Reverse resolution
Find the name of a machine from its IP address.
Service identification
Identify machines sharing a network service, e.g. the mail servers (MX) of a domain.
02A brief history
Before 1984 — centralised
A single file, HOSTS.TXT, maintained by SRI-NIC and downloaded by every machine via FTP. Still present locally today: /etc/hosts (Unix) or C:\Windows\System32\drivers\etc\hosts.
- Static mapping, minimal information
- Slow propagation of updates
- Fine for a few hundred hosts in the 70s, impossible for millions today
After 1984 — distributed
Paul Mockapetris designs DNS (RFC 882/883, then RFC 1034/1035).
- Hierarchical: tree model, like a file system's directories
- Distributed: decentralised databases; each site manages its own data
- Richer: stores extra information (mail relays…)
- Dynamic: mappings can be updated
03Architecture: three components
Domain name space
The tree of domain names and the resource records attached to them.
Name servers
Hold partial knowledge of the tree (one or more zones) and know the addresses of other name servers.
Resolvers
Client programs that query name servers to answer requests from applications.
Three points of view on the same system
| Point of view | What DNS looks like |
|---|---|
| User | A simple procedure or system call to a local resolver. The name space is one single tree, entirely accessible. |
| Resolver | An unknown number of name servers, each holding pieces of the tree. The resolver treats each database as essentially static. |
| Name server | A set of separate local data sets called zones. The server keeps copies of some zones, refreshes them periodically (from local master files or other servers) and handles resolver queries concurrently. |
04The hierarchy
DNS is an inverted tree. The root, written as a dot ., is at the top; each node has a label and its own database. Together these databases form a hierarchical, distributed information system.
www.univ-mlv.fr.gTLD
Generic: .com .net .org .gov .mil .edu .int
New gTLD
.biz .info .pro .museum .coop…
ccTLD
Country codes: .fr .us .ca .uk…
www.education.gouv.fr.05Delegation, domains & zones
Delegation
A parent node hands responsibility for a child node to another entity: the parent simply records where to find the child's database (its name servers). A parent can have many children.
Goal: distribute management — one database per node, administered in a decentralised way, with distinct areas of responsibility. Example: the root delegates .com to Verisign, which delegates google.com to Google.
Domain
A whole sub-tree. The fr. domain covers everything below the fr node.
Zone
The descriptive part for one level: the database (zone file) describing a node, managed by one administrator. A name server manages one or more zones.
06Root servers
There are 13 logical root server identities, a.root-servers.net to m.root-servers.net. They know the servers of every top-level domain and are contacted by local name servers that cannot resolve a name themselves.
Who runs them?
The root zone is overseen by IANA / ICANN; the 13 identities are operated by organisations such as Verisign (a, j), USC-ISI (b), Cogent (c), Univ. of Maryland (d), NASA (e), ISC (f), US DoD (g), US Army Research Lab (h), Netnod/Autonomica (i), RIPE NCC (k), ICANN (l), WIDE (m).
Anycast
Behind the 13 identities sit hundreds of physical servers worldwide. Anycast routing sends each query to the nearest instance — speed and redundancy. Map and list: root-servers.org.
07Clients & server roles
Client: the resolver
Client-side interface used to query a server. Machines point to a default DNS server (and usually a secondary one), configured in /etc/resolv.conf on Unix.
Server
Each server manages its own database, optimised by caching and replication. The service runs on port 53.
Types of servers
| Role | Characteristics |
|---|---|
| Primary (master) | Holds the master database, loaded from the zone file where updates are made (read/write). Holds the Start Of Authority (SOA) for the zone. |
| Secondary (slave) | Read-only mirror of the master, saved to disk. Gets its data automatically from a primary (or another secondary) by zone transfer (AXFR). Also authoritative. Provides backup, load balancing and availability. |
| Caching server | Not authoritative. If the answer is not in its cache, it forwards the query (recursively) and stores the result in its cache. |
08Resolution process
- An application (browser, mail or FTP client…) needs an IP: it asks the local resolver on the machine.
- The resolver sends the query to the local name server. If the name belongs to its zone (or is cached), it answers directly.
- Otherwise the local server walks the hierarchy: root → TLD server → authoritative server of the domain, then returns the answer to the client.
Iterative query
A server that cannot answer returns the address of a better-placed server to the requester ("ask this one"). The local server may query several servers before getting the answer.
Recursive query
Server A asks B, which takes charge of the query and asks C, and so on; the answer travels back to A ("go and find it for me").
09Caching & TTL
Every application (HTTP, SMTP, FTP…) depends on DNS, so resolution time is added to the application's response time. To limit this — and the load on the global network — servers store answers in a cache (local memory). On each request a server checks its cache first; entries are removed after a set time.
TTL — Time To Live
A value in seconds, set on each record, saying how long it may stay in cache.
Short TTL (e.g. 60 s)
Changes propagate fast, but more queries and more load.
Long TTL (e.g. 86400 s = 1 day)
Stable and efficient, but changes take longer to propagate.
10Resource records (RR)
A name server's database is made of resource records. Each RR has four elements: Name, Value, Type, TTL.
| Type | Name | Value contains… |
|---|---|---|
A | Address | The IPv4 address (32-bit) — the most common record. |
AAAA | Quad A | The IPv6 address (128-bit). |
CNAME | Canonical Name | The canonical (original) name for an alias. |
MX | Mail Exchange | The mail server(s) of the domain, with a priority. |
NS | Name Server | The name server(s) for the domain — used for delegation. |
SOA | Start Of Authority | The server holding authority over the zone, plus zone parameters. |
PTR | Pointer | The host name for a known IP (reverse resolution). |
TXT | Text | Free text, often for verification and email security (SPF, DKIM). |
www.education.gouv.fr, 62.63.163.62, A, 360011Case study: registering a domain
The startup Network Utopia wants the name networkutopia.com.
- It registers the name with a DNS registrar (e.g. Network Solutions), giving the names and IPs of its authoritative name servers (primary and secondary).
- The registrar adds two records to the
.comTLD server:
(networkutopia.com, dns1.networkutopia.com, NS)
(dns1.networkutopia.com, 212.212.212.1, A) - The company sets up its authoritative name server and adds
Arecords for its hosts and anMXrecord for its mail server.
12Diagnostic tools
nslookup
Older tool, available on every OS. Good for quick checks.
host
Simple, concise Unix lookup tool.
dig
Domain Information Groper. Standard on Linux/macOS — detailed and precise.
13Dynamic DNS
A static update means editing two files by hand: the forward zone (name → IP) and the reverse zone (IP → host name).
RFC 2136 defines an UPDATE operation for dynamic updates of DNS data — useful when addresses change often (e.g. hosts receiving addresses by DHCP).
14DNS security
Original DNS is unencrypted (mostly UDP port 53), which makes it vulnerable to spoofing and cache poisoning (injecting false answers into a resolver's cache).
DNSSEC
Cryptographic signatures on records: guarantees authenticity and integrity (not confidentiality).
DoH
DNS over HTTPS: queries encrypted inside HTTPS traffic, port 443.
DoT
DNS over TLS: a dedicated encrypted channel, port 853.
15Key takeaways
- DNS replaced the centralised
HOSTS.TXTin 1984 (RFC 1034/1035). - Three components: name space, name servers, resolvers.
- Inverted tree: root
.→ TLD → 2nd level → hosts; a full name is an FQDN. - Delegation spreads management; a zone is the data for one node, a domain is a whole sub-tree.
- 13 root identities (a–m), hundreds of anycast instances.
- Primary (SOA, read/write) → secondary (AXFR copy); caching servers are not authoritative.
- Client → local server: recursive. Local server → hierarchy: iterative.
- Caching speeds things up; the TTL sets how long an answer is kept.
- An RR = name, value, type, TTL (A, AAAA, CNAME, MX, NS, SOA, PTR, TXT).
- Tools:
nslookup,host,dig. Security: DNSSEC, DoH, DoT.