Skip to content

DNS Architecture and Operations

DNS infrastructure is the backbone of Internet naming. Beyond the recursive resolution process Covered in the DNS fundamentals document, this deep dive covers the operational side: how zones are Managed, how delegation works, how DNSSEC provides authenticity, how anycast enables global scale, And how enterprise DNS is designed for reliability and security.

Understanding DNS architecture is critical for systems engineers because virtually every service Depends on DNS. When DNS fails, everything fails — websites, APIs, email, authentication, service Discovery, container orchestration.

Registrars are accredited businesses that sell domain names to registrants (organizations, Individuals). Examples: GoDaddy, Namecheap, Cloudflare Registrar, AWS Route 53. The registrar Interface is where you:

  • Register a domain name
  • Set name server records (delegation)
  • Manage WHOIS contact information
  • Configure DNSSEC signing (DS records at the parent)

Registries operate the TLD (Top-Level Domain) zone. They maintain the authoritative name servers for The TLD and accept registrations from registrars. Examples:

  • Verisign operates .com and .net
  • PIR operates .org
  • Google Registry operates .dev``.app``.page
  • Nominet operates .uk

The registry does not interact with end users. The registrar communicates with the registry on Behalf of the registrant.

TLD operators run the authoritative name servers for a TLD. For .comVerisign runs 13 logical Name server clusters (a through m.gtld-servers.net) deployed as anycast instances worldwide. These Servers respond to queries asking “where is the authoritative name server for example.com?”

The root zone (.) is the apex of the DNS hierarchy. ICANN coordinates the root zone, which is Served by 13 logical root server networks (A through M) operated by different organizations:

LabelOperatorAnycast instances
AVerisign100+
BUSC ISI6
CCogent Communications10+
DUniversity of Maryland10+
ENASA Ames Research Center10+
FInternet Systems Consortium (ISC)60+
GUS Department of Defense10+
HUS Army Research Lab6
INetnod50+
JVerisign100+
KRIPE NCC30+
LICANN20+
MWIDE Project10+

The “13” is a historical limit from the original DNS specification (UDP packet size constraints). Today, each logical root server is deployed as an anycast cluster with dozens to hundreds of Physical instances.

Every DNS zone has exactly one SOA (Start of Authority) record. It defines the zone”s primary name Server, the responsible person’s email, and timing parameters for zone transfers and negative Caching.

example.com. 3600 IN SOA ns1.example.com. hostmaster.example.com. (
2024011501 ; Serial (YYYYMMDDNN format)
3600 ; Refresh (slave checks master every 1 hour)
900 ; Retry (on failure, retry every 15 minutes)
604800 ; Expire (after 1 week without refresh, zone is stale)
86400 ; Minimum TTL (negative cache TTL for NXDOMAIN)
)

The serial number is how slaves determine whether the zone has changed. When the slave’s serial Matches the master’s, no transfer is needed. When the master’s serial is higher, the slave requests A transfer.

Serial number formats:

  • YYYYMMDDNN: Recommended. 2024011501 = January 15, 2024, revision 01. Easy to read, prevents rollover confusion.
  • Incremental: Simple counter (1, 2, 3…). Easy to forget to increment.
  • UNIX timestamp: Seconds since epoch. Precise but hard to read.

NSEC3 zone enumeration resistance is not absolute. An attacker with sufficient resources can Brute-force the hashes for common names. NSEC3 with opt-out (unsigned delegations are not covered) Provides weaker security but better performance for large zones.

Anycast assigns the same IP address to multiple servers in different locations. BGP routes traffic To the nearest (topologically closest) server. For DNS, this means queries are answered by the Closest name server instance.

Client in Tokyo Client in London
| |
|--> 198.51.100.1 -------->|--> 198.51.100.1 ---------|
| (anycast) | (anycast)
v v
[Tokyo DNS instance] [London DNS instance]
198.51.100.1 198.51.100.1

All 13 root server operators use anycast. The a-root (198.41.0.4) has over 100 instances worldwide. This provides:

  • Latency reduction: Queries are answered by the closest instance ( under 50ms)
  • Availability: If one instance fails, BGP withdraws the route and traffic goes to the next closest
  • DDoS resilience: Attack traffic is distributed across all instances

CDNs like Cloudflare, Akamai, and Fastly use anycast for their authoritative DNS. When a client Queries www.example.com and the CDN’s DNS returns an IP address, the client is directed to the Nearest CDN edge server.

Terminal window
# Test which root server instance you hit
dig @198.41.0.4 . NS +short
# Compare with another location
dig @198.41.0.4 . NS +short +timeout=2
# Measure latency to different DNS servers
dig @8.8.8.8 example.com +stats | grep "Query time"
dig @1.1.1.1 example.com +stats | grep "Query time"

Split-horizon DNS (also called split-view DNS or split-brain DNS) provides different DNS responses Depending on the source of the query. Internal clients get internal IP addresses; external clients Get external IP addresses.

Internal query for db.example.com:
Response: 10.0.0.50 (private database server)
External query for db.example.com:
Response: REFUSED or different public IP
// Internal view (for 10.0.0.0/8 clients)
view "internal" {
match-clients { 10.0.0.0/8; };
zone "example.com" {
type master;
file "/etc/bind/db.example.com.internal";
};
};
// External view (for everyone else)
view "external" {
match-clients { any; };
zone "example.com" {
type master;
file "/etc/bind/db.example.com.external";
};
};
  • Internal services: Database servers, management interfaces, internal APIs should not be resolvable from the Internet
  • Development vs production: Developers resolve api.example.com to a staging server; production users resolve to the production server
  • GeoDNS: Different responses based on geography (but anycast is better for this)

The simplest form of DNS load balancing. Multiple A records for the same name, with the resolver Cycling through them.

example.com. 300 IN A 93.184.216.1
example.com. 300 IN A 93.184.216.2
example.com. 300 IN A 93.184.216.3

Limitations:

  • No health checking. If one server goes down, DNS still returns its IP. Clients get connection refused.
  • Caching. Resolvers cache the full RRset and distribute it independently of the authoritative server’s order.
  • Uneven distribution. Clients that share a recursive resolver all get the same answer.

Some DNS providers (AWS Route 53, Cloudflare) support weight-based routing:

example.com. 300 IN A 93.184.216.1 ; weight 3 (75% of traffic)
example.com. 300 IN A 93.184.216.2 ; weight 1 (25% of traffic)

Return different IP addresses based on the query source’s geographic location:

; European clients
example.com. 300 IN A 93.184.216.1 ; geo: EU
; US clients
example.com. 300 IN A 93.184.216.2 ; geo: US
; Asian clients
example.com. 300 IN A 93.184.216.3 ; geo: APAC

This is how CDNs direct users to the nearest edge server.

AspectInternal DNSExternal DNS
PurposeCorporate infrastructure resolutionPublic-facing services
ServersAD Domain Controllers, dedicated DNSCloud provider or third-party
Zonescorp.example.com, ad.example.comexample.com
RecordsPrivate IPs, SRV for internal servicesPublic IPs, MX, TXT for security
ForwardingInternal recursive resolversISP or public resolvers
SecurityProtected by firewall, no public accessPublic, DDoS protected
DNSSECOptional (internal trust)Recommended

Active Directory is completely dependent on DNS. AD domain controllers register SRV records that Clients use to locate domain services:

_ldap._tcp.dc._msdcs.corp.example.com. IN SRV 0 100 389 dc1.corp.example.com.
_kerberos._tcp.dc._msdcs.corp.example.com. IN SRV 0 100 88 dc1.corp.example.com.

If DNS for AD is misconfigured, authentication, group policy, and all AD-dependent services fail.

Forwarding: The DNS server forwards queries it cannot answer to an upstream resolver (e.g., 8.8.8.8 or the ISP’s resolver). Simple to configure but adds latency and a dependency.

Recursion: The DNS server performs the full resolution itself (querying root, TLD, authoritative Servers). More control, can be faster with caching, but more complex to configure and secure.

Best practice for enterprise: use dedicated recursive resolvers (Unbound, BIND) that perform Recursion, not forwarding. This gives you control over caching behavior, logging, and security Policies.

/etc/unbound/unbound.conf
# Unbound configuration for recursive resolution
server:
interface: 0.0.0.0@53
access-control: 10.0.0.0/8 allow
do-not-query-localhost: no
hide-identity: yes
hide-version: yes
prefetch: yes
prefetch-key: yes
forward-zone:
name: "."
forward-addr: 8.8.8.8
forward-addr: 1.1.1.1

The most important DNS troubleshooting command. It traces the full resolution path from the root Down to the authoritative server.

Terminal window
# Full resolution trace
dig +trace example.com
# Trace with DNSSEC validation
dig +trace +dnssec example.com
# Trace specific record type
dig +trace example.com MX
# Trace from a specific recursive resolver
dig @8.8.8.8 +trace example.com
Terminal window
# Query a specific authoritative server
dig @ns1.example.com example.com A
# Show the full DNSSEC chain
dig example.com DNSKEY +dnssec +multiline
dig example.com DS +dnssec +multiline
# Check delegation
dig example.com NS @a.gtld-servers.net
# Test DNSSEC validation
dig example.com A +dnssec +cd # disable checking (cd = checking disabled)
dig example.com A +dnssec # enable checking
# Measure query time
dig example.com +stats
# Query over TCP (when UDP is blocked or truncated)
dig +tcp example.com
# Query with EDNS0
dig +edns=0 example.com
# Show all record types for a name
dig example.com ANY +noall +answer

Real-time DNS traffic monitoring:

Terminal window
# Monitor DNS traffic on eth0
dnstop eth0
# Filter by source
dnstop -l 10.0.0.0/8 eth0
Terminal window
# Capture DNS queries and responses
tcpdump -i eth0 -n port 53
# Capture only queries (no responses)
tcpdump -i eth0 -n 'port 53 and udp[10:2] & 0x8000 = 0'
# Capture only responses
tcpdump -i eth0 -n 'port 53 and udp[10:2] & 0x8000 != 0'
# Capture DNS over TCP
tcpdump -i eth0 -n 'tcp port 53'
# Save to pcap for analysis
tcpdump -i eth0 -n -w /tmp/dns-capture.pcap port 53

The queried name does not exist in the zone. Causes:

  • Typo in the domain name
  • Record not yet created (propagation delay)
  • Record deleted
  • Wildcard not configured (if expected)
Terminal window
# Check if the name exists
dig example.com A @ns1.example.com
# Check for typos
dig exmple.com A # oops

The authoritative server encountered an error. Causes:

  • DNSSEC validation failure (broken chain of trust)
  • Server misconfiguration
  • Server overloaded or unreachable
  • Broken zone file syntax
Terminal window
# Check DNSSEC chain
dig example.com DNSKEY +dnssec @ns1.example.com
dig example.com RRSIG A +dnssec @ns1.example.com
# Check server health
dig example.com A @ns1.example.com +timeout=5
dig example.com SOA @ns1.example.com

Cache poisoning occurs when an attacker injects forged DNS responses into a recursive resolver’s Cache, causing subsequent queries to return malicious IP addresses.

Mitigations:

  • Source port randomization: The resolver uses random source ports for queries (RFC 5452). An attacker must guess both the query ID (16 bits) and the source port (16 bits), making spoofing much harder.
  • DNSSEC: The resolver validates signatures. Even if a forged response is accepted into the cache, DNSSEC validation rejects it.
  • DNS-over-TLS / DNS-over-HTTPS: Encrypt the query path, preventing interception and injection.
  • 0x20 encoding: Randomize the case of the query name. The response must match the case, making forgery harder.