DNS, Root Servers, and DNSSEC
DNS is the internet's phonebook. Every time you type a domain name, a global network of servers translates it to an IP address. This lesson covers how DNS works, the 13 root servers, and DNSSEC—the security layer that prevents DNS hijacking.
Context: The DNS Hierarchy
Domain names are structured hierarchically. www.example.com breaks down as:
.com— the TLD (Top Level Domain).example.com— the second-level domain owned by Example Inc.www.example.com— a subdomain (the "www" host).
The DNS hierarchy mirrors this structure, with authoritative nameservers at each level. Your recursive resolver (usually at your ISP) starts at the root and walks down the tree to find the answer.
The 13 DNS Root Servers
At the top of the DNS hierarchy are 13 root nameservers. They don't know the IP of www.example.com, but they know which nameservers are authoritative for the .com TLD. Operated by organizations like ICANN, Verisign, and others, these 13 servers are the foundation of the entire DNS system.
| Root Server | Operator | Address (IPv4) |
|---|---|---|
| A | VeriSign | 198.41.0.4 |
| B | USC/ISI | 199.9.14.201 |
| C | Cogent Communications | 192.33.4.12 |
| D | University of Maryland | 199.7.91.13 |
| E | NASA Ames | 192.203.230.10 |
| F | ISC | 192.5.5.241 |
| G | US DoD NIC | 192.112.36.4 |
| H | US Army Research Lab | 198.97.190.53 |
| I | Netnod | 192.36.148.17 |
| J | VeriSign | 192.58.128.30 |
| K | RIPE NCC | 193.0.14.129 |
| L | ICANN | 199.7.83.42 |
| M | WIDE Project | 202.12.27.33 |
Why 13? DNS UDP packets have a 512-byte limit (before EDNS). The root zone hints file (which maps A–M to IP addresses) fits in that space with 13 servers. There are actually more than 13 physical servers worldwide (each root is anycast-replicated), but they are all known by these 13 labels.
How DNS Resolution Works
When you type www.example.com in your browser, here's the journey:
- Your browser queries a recursive resolver: Usually your ISP's resolver or a public one like 8.8.8.8 (Google). The resolver has a cache of recent answers.
- Cache miss → Root server query: The resolver queries a root server asking "Where can I find .com?" The root server responds with the IP address of a .com TLD nameserver.
- TLD nameserver query: The resolver queries the .com nameserver asking "Where can I find example.com?" The TLD nameserver responds with the IP address of Example Inc.'s authoritative nameserver.
- Authoritative nameserver query: The resolver queries Example Inc.'s authoritative nameserver asking "What's the IP of www.example.com?" The authoritative server responds with the IP (e.g., 93.184.216.34).
- Answer returned to your browser: The resolver sends the IP back to your browser, which opens a TCP connection to that IP.
- Caching: Along the way, each nameserver caches the answer for its TTL (Time To Live, typically 300 seconds), so the next query for www.example.com is answered faster.
DNS Record Types
Authoritative nameservers store multiple record types. Here are the most important:
| Record Type | Purpose | Example |
|---|---|---|
| A | IPv4 address | www.example.com A 93.184.216.34 |
| AAAA | IPv6 address | www.example.com AAAA 2606:4700::1111 |
| CNAME | Canonical name (alias) | www.example.com CNAME example.com |
| MX | Mail server | example.com MX 10 mail.example.com |
| NS | Nameserver for a zone | example.com NS ns1.example.com |
| SOA | Start of Authority (zone metadata) | example.com SOA ns1.example.com admin.example.com ... |
| TXT | Text data (SPF, DKIM, DMARC) | example.com TXT "v=spf1 include:_spf.example.com ~all" |
| DS | DNSSEC Delegation Signer | (used for DNSSEC validation) |
DNSSEC: Securing the DNS Hierarchy
DNS was designed before security was a priority. Without DNSSEC, an attacker can hijack DNS queries by poisoning the resolver's cache or intercepting the response. For example, an attacker could redirect bank.com to a phishing site.
DNSSEC adds cryptographic signatures to DNS responses, proving they came from the authoritative source.
How DNSSEC Works
- Zone owner creates keys: The zone owner (e.g., Example Inc.) generates a KSK (Key Signing Key) and ZSK (Zone Signing Key).
- Sign the zone: All DNS records are signed with the ZSK. The ZSK itself is signed with the KSK. The KSK's public key is published.
- DS record at the parent: A DS (Delegation Signer) record—a hash of the KSK—is published at the parent zone (the .com TLD nameserver). This creates a chain of trust: .com TLD validates example.com by checking example.com's DS record against the KSK.
- Validator checks the chain: When a resolver receives a response for www.example.com, it verifies:
- The www.example.com A record is signed with example.com's ZSK.
- The ZSK is signed with example.com's KSK.
- The KSK fingerprint matches the DS record at the .com TLD.
- The DS record at .com is signed by the .com TLD's ZSK.
- The .com TLD's ZSK is signed by its KSK.
- ...and so on up to the root zone, which is self-signed.
- Answer is secure: If all signatures check out, the answer is SECURE. If any signature fails, the answer is BOGUS and is rejected.
DNSSEC Deployment
To enable DNSSEC on your domain:
- Generate a KSK and ZSK at your authoritative nameserver.
- Sign your zone with the ZSK.
- Generate a DS record from your KSK and provide it to your registrar.
- Your registrar publishes the DS record at the TLD nameserver, creating the chain of trust.
Example (using BIND):
# Generate keys
dnssec-keygen -a RSASHA256 -b 2048 -f KSK example.com
dnssec-keygen -a RSASHA256 -b 1024 example.com
# Sign the zone
dnssec-signzone -o example.com -k example.com.key example.com.zone
# Extract DS record to give to registrar
cat example.com.dsset
Most DNS hosting providers (Route53, Cloudflare, etc.) handle DNSSEC automatically. You just enable it in the UI and provide the DS record to your registrar.
DNSSEC Chain of Trust
The root zone is signed and self-signed (the root's ZSK signs its own records). Your browser trusts the root's public key (hard-coded in resolvers). Every TLD (like .com) is signed by the root. Every domain under a TLD (like example.com) is signed by the TLD. This creates an unbroken chain of trust from the root down to your domain.
DNSSEC Adoption Is Slow
Like RPKI, DNSSEC adoption is around 30% of domains globally. It adds operational complexity, and misconfiguration can break DNS entirely (BOGUS responses). But it's mandatory for certain industries (e.g., financial, government) and is gradually becoming expected practice.
Testing DNSSEC
You can test DNSSEC validation with dig:
# Query a DNSSEC-secured domain
dig +dnssec www.example.com
# Output includes ad (authentic data) flag and RRSIG records
; <<>> DiG 9.18.0 <<< +dnssec www.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12345
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; ANSWER SECTION:
www.example.com. 300 IN A 93.184.216.34
www.example.com. 300 IN RRSIG A 8 3 300 ...signature...
The ad (authentic data) flag means DNSSEC validation succeeded.
Summary
- DNS resolves domain names to IP addresses using a hierarchical structure: root → TLD → authoritative nameserver.
- The 13 DNS root servers are the foundation. They're anycast-replicated globally and operated by organizations like VeriSign and ICANN.
- DNSSEC adds cryptographic signatures to DNS records, proving they came from the authoritative source and protecting against hijacking.
- DNSSEC creates a chain of trust: root → TLD → domain. Each level signs the next, up to your domain's records.
- To enable DNSSEC, generate keys, sign your zone, and provide a DS record to your registrar.
- DNSSEC adoption is growing but still optional for most domains. Expect it to become standard over time.
- Further reading: RFC 4033 (DNSSEC Introduction), RFC 4034 (DNSSEC RRSIG), RFC 4035 (DNSSEC Validation).