You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
The Domain Name System (DNS) is the Internet's phonebook. It translates human-readable domain names (like example.com) into IP addresses (like 93.184.216.34) that computers use to identify each other. Without DNS, you would need to memorise IP addresses for every website.
When you type www.example.com into your browser:
1. Browser cache → Is it already cached? If yes, done.
2. OS cache → Check the local DNS cache
3. /etc/hosts → Check the local hosts file
4. Resolver → Ask your configured DNS resolver (e.g., ISP or 8.8.8.8)
5. Root server → "I don't know, but .com is handled by these TLD servers"
6. TLD server → "example.com is handled by these authoritative servers"
7. Authoritative → "www.example.com is 93.184.216.34"
8. Response cached and returned to the browser
DNS is organised as a hierarchical, distributed database:
. (Root)
/ | \
/ | \
.com .org .uk ← Top-Level Domains (TLDs)
/ | \
example wikipedia bbc ← Second-Level Domains
| | |
www en www ← Subdomains / Hosts
| Component | Count | Purpose |
|---|---|---|
| Root servers | 13 sets (hundreds of instances via anycast) | Direct queries to TLD servers |
| TLD servers | One set per TLD (.com, .org, .uk, etc.) | Direct queries to authoritative servers |
| Authoritative servers | Per domain | Hold the actual DNS records for a domain |
| Recursive resolvers | Run by ISPs, Google (8.8.8.8), Cloudflare (1.1.1.1) | Do the heavy lifting of resolving queries |
| Record | Purpose | Example |
|---|---|---|
| A | Maps a name to an IPv4 address | example.com → 93.184.216.34 |
| AAAA | Maps a name to an IPv6 address | example.com → 2606:2800:220:1:248:1893:25c8:1946 |
| CNAME | Alias — points one name to another | www.example.com → example.com |
| MX | Mail exchange server for the domain | example.com → mail.example.com (priority 10) |
| NS | Authoritative name servers for the domain | example.com → ns1.example.com |
| TXT | Arbitrary text (SPF, DKIM, domain verification) | "v=spf1 include:_spf.google.com ~all" |
| SOA | Start of Authority — primary server and zone metadata | Serial number, refresh interval, TTL |
| PTR | Reverse DNS — maps IP to a name | 34.216.184.93 → example.com |
| SRV | Service location (host, port, priority) | _sip._tcp.example.com → sipserver.example.com:5060 |
| Query Type | Description |
|---|---|
| Recursive | The client asks the resolver to do all the work and return the final answer |
| Iterative | The resolver asks each server in turn, following referrals until it finds the answer |
In practice, your device makes a recursive query to your resolver, and the resolver performs iterative queries on your behalf.
To reduce load and speed up resolution, DNS responses are cached at multiple levels:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.