Domains and DNS
Every time google.com is typed into a browser, a behind-the-scenes lookup converts that human-readable name into a machine-readable IP address. Understanding how this works demystifies a process that is invisible yet happens billions of times every day.
Target reader: Beginners who want to understand how domain names and DNS work. Estimated time: 10 min read + 5 min hands-on Prerequisites: What Is the Internet? (recommended)
What a Domain Name Is
Section titled “What a Domain Name Is”A domain name is a human-readable alias for an IP address. IP addresses like 142.250.80.46 are hard to remember. Domain names like google.com are easy to type and share.
The relationship is like a contacts list on a phone. The phone stores a number (the IP address), but the display shows a name (the domain). Looking up “Alice” in the contacts retrieves the actual phone number. DNS does the same for domain names.
Domain Name Anatomy
Section titled “Domain Name Anatomy”A domain name is read from right to left in terms of hierarchy:
subdomain . second-level domain . top-level domain
www . example . com| Part | Example | Description |
|---|---|---|
| TLD (Top-Level Domain) | .com | The rightmost segment; broadest category |
| Second-level domain | example | The name registered by a person or organization |
| Subdomain | www | A prefix added by the domain owner; optional |
The combination of second-level domain and TLD — example.com — is what is registered and owned.
TLD Types
Section titled “TLD Types”| Type | Examples | Purpose |
|---|---|---|
| Generic TLD (gTLD) | .com, .net, .org, .io, .app | General-purpose; .com is the most recognizable |
| Country Code TLD (ccTLD) | .jp, .uk, .de, .au | Tied to a specific country |
| Sponsored TLD | .edu, .gov, .mil | Restricted to specific organizations |
| New gTLD | .tech, .design, .ai | Introduced after 2012; growing in number |
.io has become popular among tech startups despite being the ccTLD for the British Indian Ocean Territory, mainly because “I/O” (input/output) resonates with developers.
What DNS Is
Section titled “What DNS Is”DNS (Domain Name System) is the global distributed database that maps domain names to IP addresses. It functions like the Internet’s phonebook.
Without DNS, every URL would need to be an IP address. DNS makes the web navigable by humans.
The DNS system is distributed — no single server stores all domain-to-IP mappings. Instead, the work is divided across a hierarchy of servers:
Root DNS Servers (13 sets worldwide)
|
TLD DNS Servers (.com, .net, .jp, ...)
|
Authoritative DNS Servers (one per registered domain)DNS Resolution Flow
Section titled “DNS Resolution Flow”When www.example.com is entered in a browser for the first time, the following chain of lookups occurs:
Browser
|
|-- Check local DNS cache (already know the IP?)
| YES: use cached IP immediately
| NO: continue below
|
v
Recursive Resolver (provided by ISP or configured manually, e.g., 8.8.8.8)
|
|-- Query Root DNS Server
| "Who handles .com?"
| <- "Ask the .com TLD server at this address"
|
|-- Query .com TLD Server
| "Who handles example.com?"
| <- "Ask the authoritative server at this address"
|
|-- Query Authoritative DNS Server for example.com
| "What is the IP for www.example.com?"
| <- "93.184.216.34"
|
v
Browser connects to 93.184.216.34The result is cached at each step for the duration specified by the domain’s TTL (Time to Live), so subsequent requests skip most of this chain.
How to Register a Domain
Section titled “How to Register a Domain”Domain names are registered through companies called domain registrars. The registrar reserves the name in the global DNS system for a fee (typically paid annually).
Well-known registrars:
| Registrar | Notes |
|---|---|
| Namecheap | Popular for affordable pricing and a clean interface |
| Google Domains / Squarespace Domains | Simple, integrated with Google services |
| Cloudflare Registrar | Sells at cost (no markup); includes free DNS and DDoS protection |
| GoDaddy | One of the largest; aggressive upselling is common |
After registering, the registrar’s dashboard provides control over DNS records — the settings that tell the world where to send traffic for that domain.
Common DNS Record Types
Section titled “Common DNS Record Types”| Record Type | Purpose | Example |
|---|---|---|
| A | Maps a domain to an IPv4 address | example.com → 93.184.216.34 |
| AAAA | Maps a domain to an IPv6 address | example.com → 2001:db8::1 |
| CNAME | Alias from one name to another | www.example.com → example.com |
| MX | Mail server for the domain | Routes email to Google Workspace, etc. |
| TXT | Arbitrary text; used for verification | SPF, DKIM, site ownership verification |
Hands-On: Looking Up a Domain
Section titled “Hands-On: Looking Up a Domain”The dig command (or nslookup on Windows) queries DNS directly from the terminal:
dig example.comThe output will show the A record — the IP address the domain resolves to — along with TTL values. This is a quick way to verify that DNS is configured correctly after making changes.
Summary
Section titled “Summary”- A domain name is a human-readable alias for an IP address.
- A domain is composed of a subdomain, second-level domain, and TLD.
- DNS is the distributed phonebook that maps names to addresses.
- DNS resolution follows a chain: browser cache → recursive resolver → root DNS → TLD DNS → authoritative DNS.
- Domains are registered through registrars and managed via DNS records.
Q: What is the difference between www.example.com and example.com?
A: Technically they are different hostnames. example.com is called the “apex” or “naked” domain. www.example.com is a subdomain. Most sites configure both to serve the same content and redirect one to the other. Neither is more “correct” — it is a convention.
Q: How long does a DNS change take to propagate?
A: DNS changes propagate within the TTL period of the old record — often between a few minutes and 48 hours. When expecting to make a change, lowering the TTL to a small value (e.g., 300 seconds) a day in advance reduces the propagation window.
Q: What is a DNS resolver (like 8.8.8.8)?
A: A DNS resolver (or recursive resolver) is a server that performs the full lookup chain on behalf of a client. 8.8.8.8 is Google’s public DNS resolver; 1.1.1.1 is Cloudflare’s. These are alternatives to the default resolver provided by an internet service provider, often offering faster lookups or privacy protections.
Next: Introduction to Databases
Link to this page (Japanese): ドメインとDNS