← Course index · R314 System & Network
MMIBUT Métiers du Multimédia et de l'Internet · IUT de Vélizy

DNS Domain Name System

Course synthesis: architecture, hierarchy, name servers, resolution, records and security.

RFC 1034 / 1035 Networking UDP/TCP port 53

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 viewWhat DNS looks like
UserA simple procedure or system call to a local resolver. The name space is one single tree, entirely accessible.
ResolverAn unknown number of name servers, each holding pieces of the tree. The resolver treats each database as essentially static.
Name serverA 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.

. comorgfrmuseum ibmmicrosoftgouvuniv-mlv educationwwwftp RootTLD2nd level3rd level / host
Reading a name from right to left = walking down the tree: 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…

FQDN (Fully Qualified Domain Name): the complete name of a host, made of every successive domain separated by dots, up to the root — e.g. 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

RoleCharacteristics
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 serverNot authoritative. If the answer is not in its cache, it forwards the query (recursively) and stores the result in its cache.

08Resolution process

  1. An application (browser, mail or FTP client…) needs an IP: it asks the local resolver on the machine.
  2. The resolver sends the query to the local name server. If the name belongs to its zone (or is cached), it answers directly.
  3. Otherwise the local server walks the hierarchy: root → TLD server → authoritative server of the domain, then returns the answer to the client.
Clientresolver Local DNSrecursive resolver Root server . TLD server .com Authoritativeexample.com ① recursive query⑧ final answer ② / ③ "ask .com"④ / ⑤ "ask ns.example.com"⑥ / ⑦ IP address
Solid = query, dashed = referral or answer. Client ↔ local DNS is recursive; local DNS ↔ hierarchy is iterative.

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").

In practice, a complete resolution combines both: recursive from client to local server, iterative from the local server through the hierarchy.

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.

# Windows C:\> ipconfig /displaydns # show the local DNS cache C:\> ipconfig /flushdns # empty the cache

10Resource records (RR)

A name server's database is made of resource records. Each RR has four elements: Name, Value, Type, TTL.

TypeNameValue contains…
AAddressThe IPv4 address (32-bit) — the most common record.
AAAAQuad AThe IPv6 address (128-bit).
CNAMECanonical NameThe canonical (original) name for an alias.
MXMail ExchangeThe mail server(s) of the domain, with a priority.
NSName ServerThe name server(s) for the domain — used for delegation.
SOAStart Of AuthorityThe server holding authority over the zone, plus zone parameters.
PTRPointerThe host name for a known IP (reverse resolution).
TXTTextFree text, often for verification and email security (SPF, DKIM).
Example RR (name, value, type, TTL): www.education.gouv.fr, 62.63.163.62, A, 3600

11Case study: registering a domain

The startup Network Utopia wants the name networkutopia.com.

  1. 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).
  2. The registrar adds two records to the .com TLD server:
    (networkutopia.com, dns1.networkutopia.com, NS)
    (dns1.networkutopia.com, 212.212.212.1, A)
  3. The company sets up its authoritative name server and adds A records for its hosts and an MX record 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.

$ dig google.com +short 142.250.75.238 $ dig google.com MX +short 10 smtp.google.com. $ nslookup www.education.gouv.fr $ dig -x 8.8.8.8 +short # reverse lookup (PTR) dns.google.

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.TXT in 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.