DNS Design & Architecture — The Complete Guide

DNS Design & Architecture — The Complete Guide | InfoTechTu
01

Overview & Summary

DNS (Domain Name System) is the backbone of the internet — it translates human-readable domain names like www.google.com into machine-readable IP addresses like 8.8.8.8. But DNS design and architecture goes far beyond simple name-to-IP resolution.

This guide covers all major DNS record types (A, AAAA, CNAME, NS, SOA, TXT, and Alias), explains the complete DNS resolution chain, and provides a practical troubleshooting framework for real-world issues like migration failures, email spam, and latency problems.

🎯

Who is this for? IT professionals, system administrators, cloud engineers, and anyone preparing for architect-level or senior engineering roles.

02

Key Concepts & Definitions

TermDefinition
DNS RecordAn entry in the DNS database containing Name, Type, Value, and TTL fields.
TTL (Time To Live)Duration (seconds) a DNS record stays cached. E.g., 3600 = 1 hour.
Root DomainThe invisible . at the end of every domain (e.g., google.com.). Entry point of resolution.
TLDTop Level Domain — .com, .org, .net, etc.
Authoritative NSThe server holding definitive DNS records for a domain. Provides the final answer.
Recursive ResolverDNS server (often ISP-provided) that chases the resolution chain on your behalf.
Dual-StackA network running both IPv4 and IPv6 simultaneously.
Negative TTLHow long a “domain doesn’t exist” (NXDOMAIN) response is cached.
SPFSender Policy Framework — email authentication mechanism configured via TXT record.
DKIMDomainKeys Identified Mail — cryptographic email verification via TXT record.
03

DNS Record Types — Step by Step

A

A Record

Address Record — The most fundamental DNS record

Maps a domain name directly to an IPv4 address. This is the first record to check when a website is unreachable.

NameTypeValueTTL
www.example.comA203.0.113.63600 (1 hr)
⚠️

Migration Trap: During server migrations, if the A record still points to the old IP, users reach the old server until the TTL expires. Always update the A record and verify TTL.

AAAA

AAAA Record

Quad-A Record — IPv6 mapping

Maps a domain name to an IPv6 address. Considered optional today, but becoming increasingly important.

NameTypeValueTTL
www.example.comAAAA2001:db8:1::13600
🔴

Dual-Stack Latency: In environments with both IPv4 & IPv6, if IPv6 is prioritized but no AAAA record exists, the system tries IPv6 first, fails, then falls back to IPv4 — adding noticeable latency.

💡

Migration Tip: Lower TTL to 60 seconds before migrations for faster propagation instead of waiting hours.

CN

CNAME Record

Canonical Name — Forwarding alias

A forwarding record that points one domain to another domain (not an IP). Think of it like a receptionist directing you to the correct floor. Heavily used with CDNs and Load Balancers in cloud environments.

NameTypeValueTTL
www.example.comCNAMElb1.aws.com3600
blog.example.comCNAMElb1.aws.com3600
api.example.comCNAMElb2.aws.com3600
🚫

Critical Limitation: A root domain (e.g., example.com) cannot be a CNAME. You must use a subdomain or an Alias record instead.

NS

NS Record

Name Server — Domain authority delegation

Designates the authoritative name servers responsible for a domain. This record tells root and TLD servers where to go to find the actual DNS records.

NameTypeValueTTL
example.comNSns1.aws.com172800 (48 hrs)

48-Hour Propagation: When migrating domains (e.g., GoDaddy → AWS Route 53), NS record changes can take up to 48 hours to propagate worldwide due to the high TTL.

SOA

SOA Record

Start of Authority — The “Constitution” of DNS

Defines administrative metadata about the DNS zone. Does not route traffic — it’s purely informational. Think of it as the constitution that governs how the DNS zone operates.

Key SOA Fields

FieldExamplePurpose
Primary NSns1.dns.comMain authoritative name server
Admin Emailadmin@example.comZone administrator contact
Serial Number2023120Version of the DNS config
Refresh Interval3600How often secondary servers sync
Negative TTL86400Cache duration for “does not exist” responses
📝

Negative TTL Example: If someone searches nope.example.com and it doesn’t exist, the Negative TTL (e.g., 24 hours) tells resolvers not to re-query for that period.

TXT

TXT Record

Text Record — Ownership & email authentication

Used for domain ownership verification and email authentication. Tells the world who owns the domain and who can send legitimate emails on its behalf.

Common Uses

SPF (Sender Policy Framework): Declares which mail servers can send email for your domain.

v=spf1 include:_spf.google.com ~all

DKIM: Cryptographic signature to prevent email spoofing.

Domain Verification: Services like Google Workspace, Slack, and Notion require TXT records to verify you own the domain.

📧

If emails land in spam: Your TXT record (SPF/DKIM) is likely misconfigured. Without proper TXT records, Google and Gmail servers cannot legitimize emails from your domain.

ALIAS

Alias Record

A-Alias — Solves the root domain CNAME limitation

Since root domains (example.com) cannot use CNAME, the Alias record was created. It behaves like a CNAME but resolves at the DNS level, returning an IP address directly. Essential when pointing a root domain to a load balancer.

04

DNS Resolution Flow

When you type a URL in your browser, here’s the complete chain of events:

  ┌───────────┐         ┌──────────────────┐         ┌─────────────┐
  │  Browser  │ ──1──►  │ Recursive         │ ──2──►  │   Root      │
  │  (User)   │         │ Resolver (ISP)    │         │   Server .  │
  └───────────┘         └──────────────────┘         └──────┬──────┘
                                │                           │
                           7 ◄──┤   Returns IP              3
                                │   & caches (TTL)          │
                                │                    ┌──────▼──────┐
                                │              4 ◄── │ TLD Server  │
                                │                    │ (.com .org) │
                                │                    └─────────────┘
                         ┌──────▼──────────┐
                     5 ► │ Authoritative    │
                         │ Name Server      │ ──6──► Returns actual IP
                         │ (A/AAAA/CNAME)   │
                         └─────────────────┘

Complete DNS resolution path: Browser → Resolver → Root → TLD → Authoritative NS → IP returned & cached

Step-by-step

1. User types www.example.com in the browser.

2. Query goes to the Recursive Resolver (usually ISP’s DNS).

3. Resolver contacts a Root Server (the hidden . at the end of the domain).

4. Root Server directs to the appropriate TLD Server (e.g., .com).

5. TLD Server directs to the Authoritative Name Server (defined by the NS record).

6. Authoritative Server returns the actual IP address.

7. Resolver caches the result (per TTL) and returns it to the browser.

05

Configuration & Best Practices

Lowering TTL Before a Migration

The single most important practice for any DNS migration: lower the TTL days before the actual change.

# BEFORE migration — lower TTL to 60 seconds
www.example.com.   60   IN   A   203.0.113.6

# AFTER migration — update IP, then restore TTL
www.example.com.   3600  IN   A   198.51.100.10DNS Zone

SPF TXT Record Setup

example.com.   IN   TXT   "v=spf1 include:_spf.google.com ~all"

# v=spf1         → declares SPF record
# include:...    → authorizes Google's mail servers
# ~all           → soft-fail for unauthorized sendersTXT Record
06

Key Takeaways

  • A Record is king — the most fundamental record. Always check it first when a website is unreachable.
  • Lower TTL before any migration — set it to 60 seconds days before so caches expire quickly.
  • CNAME cannot be used on root domains — use an Alias record instead.
  • NS record propagation takes up to 48 hours — plan domain migrations well in advance.
  • TXT records protect email reputation — misconfigured SPF/DKIM means your emails land in spam.
  • SOA record controls refresh behavior — check its refresh interval if DNS changes aren’t propagating.
  • Dual-stack IPv6 fallback adds latency — no AAAA record means slow fallback to IPv4.
  • CNAME misconfiguration = silent failures — wrong load balancer endpoint breaks traffic without clear errors.
  • Don’t forget the root dot — every domain ends with . — understanding this helps debug resolution chains.
07

Troubleshooting Guide

ProblemLikely CauseFix
Website not foundA record pointing to wrong/old IPUpdate A record; verify TTL expired
Slow page loadsMissing AAAA in dual-stack envAdd AAAA record or disable IPv6 preference
“Domain not found”CNAME or NS records not updatedVerify CNAME targets; confirm NS points to new provider
Works for some, not othersSOA refresh too long; TTL too highLower SOA refresh interval & reduce TTL
Emails in spamTXT (SPF/DKIM) misconfiguredAdd proper SPF and DKIM TXT records
Root domain can’t use LBCNAME used on root domainUse Alias (A-Alias) record instead
Changes not propagatingOld TTL still cached; NS delayWait for TTL expiry; NS changes need up to 48h
Service can’t verify domainTXT record missing/incorrectAdd verification TXT record from the service
08

Recall Questions

Click each question to reveal the answer.

What does an A record do?
Maps a domain name to an IPv4 address. It’s the most fundamental DNS record.
What’s the difference between A and AAAA records?
A record maps to IPv4; AAAA record maps to IPv6. AAAA is optional but growing in importance.
Why can’t you use a CNAME on a root domain?
DNS protocol forbids CNAME at the zone apex (root). Use an Alias record instead.
What should you do to TTL before a migration?
Lower it (e.g., to 60 seconds) days before so caches refresh quickly after the IP change.
What is the role of an NS record?
It designates the authoritative name servers responsible for a domain — tells root/TLD servers where to find the domain’s records.
Why might DNS changes take up to 48 hours?
NS records often have a TTL of 172800 seconds (48 hours), so cached entries worldwide take that long to expire.
What does the SOA record’s Negative TTL control?
How long a “domain doesn’t exist” (NXDOMAIN) response is cached, preventing repeated queries for non-existent records.
Emails landing in spam — which record to check?
The TXT record — specifically SPF and DKIM configurations.
What causes latency in a dual-stack env without AAAA?
System tries IPv6 first, fails, then falls back to IPv4 — the fallback adds noticeable delay.
What analogy describes the SOA record?
The “constitution” of DNS — defines administrative rules for the zone but doesn’t route traffic.
09

Mind Map

DNS Design & Architecture
│
├── DNS Resolution
│   ├── Name → IP Translation
│   ├── Recursive Resolver → Root → TLD → Authoritative Server
│   └── Root Domain (hidden "." at end of every domain)
│
├── Core DNS Records
│   ├── A Record ─────── Domain → IPv4 (most fundamental)
│   ├── AAAA Record ──── Domain → IPv6 (optional, growing)
│   │   └── ⚠ Dual-stack fallback latency risk
│   ├── CNAME Record ─── Domain → Another Domain
│   │   ├── Used with CDNs & Load Balancers
│   │   └── 🚫 Cannot be used on root domains
│   ├── NS Record ────── Delegates to Authoritative Servers
│   │   └── ⏳ Propagation up to 48 hours
│   ├── SOA Record ───── Zone Admin Metadata
│   │   ├── Refresh Interval
│   │   └── Negative TTL
│   ├── TXT Record ───── Ownership & Email Auth
│   │   ├── SPF (email authorization)
│   │   └── DKIM (email signing)
│   └── Alias Record ─── Solves CNAME root limitation
│
├── Key Concept: TTL
│   ├── Controls cache duration
│   ├── Lower before migration (60s)
│   └── High TTL = slow propagation
│
└── Troubleshooting
    ├── Site not found ──── Check A / CNAME / NS
    ├── Latency ─────────── Check AAAA / dual-stack
    ├── Partial propagation ─ Check SOA refresh + TTL
    └── Email spam ──────── Check TXT (SPF / DKIM)
10

Additional References

ResourceDescription
AWS Route 53Amazon’s DNS service with native Alias record support
GoDaddyPopular domain registrar, common in migration scenarios
CDNContent Delivery Network — CNAME records often point to CDN endpoints
nslookupCLI tool to query DNS records
digAdvanced DNS lookup utility (Linux/Mac)
hostSimple DNS lookup command
whoisDomain registration information lookup

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top