惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
V
V2EX
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
小众软件
小众软件
Vercel News
Vercel News
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
J
Java Code Geeks
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog
B
Blog
美团技术团队
量子位

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
DNS Explained: How Your Browser Decodes Website Addresses
Jino R Krishnan · 2026-06-26 · via DEV Community

You type www.google.com into your browser and hit Enter. The page loads in under a second.

But stop and think about what just happened. Your browser didn't know where Google lives on the internet. It had to ask. And in that fraction of a second, a surprisingly elegant chain of lookups took place behind the scenes.

That system is called DNS — the Domain Name System. Think of it as the internet's phonebook: it translates human-friendly names like www.google.com into machine-friendly IP addresses like 142.250.80.46. Without it, you'd have to memorise numbers to visit any website.

Let's walk through exactly what happens, step by step.

Step 1: You Type a URL — But What Does It Mean?

When you type www.bing.com, you're entering a domain name. Domain names have a structure — and reading them right-to-left tells you a lot:

www . bing . com
 │      │     │
 │      │     └── Top-Level Domain (TLD): category or country
 │      └──────── Second-Level Domain (SLD): the brand/org name
 └─────────────── Subdomain: a section of the site (optional)

Some real examples:

Domain TLD SLD Subdomain
www.bing.com .com bing www
news.bbc.co.uk .uk bbc news
docs.github.com .com github docs

TLDs indicate the type or origin of a site — .com for commercial, .edu for education, .in for India, and so on.

Step 2: Your Browser Checks Locally First

Before going anywhere on the internet, your browser does a quick local check — two of them, actually.

1. Browser cache
Modern browsers cache DNS results from previous lookups. If you visited bing.com five minutes ago, the browser already knows its IP and skips the entire lookup process.

2. The hosts file
Your operating system has a plain text file that maps domain names to IPs manually. On most systems it lives at:

  • Windows: C:\Windows\System32\drivers\etc\hosts
  • Mac/Linux: /etc/hosts

It looks like this:

127.0.0.1    localhost
192.168.1.10 mydevserver.local

Developers use this all the time for local testing — mapping a production domain name to a local IP to test before going live.

If neither cache nor hosts has an answer, the real DNS lookup begins.

Step 3: Your OS Asks a Recursive Resolver

Your OS passes the query to a Recursive Resolver (sometimes called a Recursive DNS server). This is typically provided by your ISP, but you can override it with public ones:

Provider DNS Address
Google 8.8.8.8
Cloudflare 1.1.1.1
OpenDNS 208.67.222.222

Pro tip: Switching to 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google) can noticeably speed up DNS resolution and improve privacy over your ISP's default resolver.

The Recursive Resolver is the workhorse. It does all the legwork of finding the answer so your device doesn't have to.

Step 4: The Resolver Walks the DNS Hierarchy

If the Recursive Resolver doesn't have the answer cached, it begins a top-down walk through the DNS hierarchy. There are three layers:

Layer 1 — Root Servers

The resolver first contacts one of the 13 root server clusters distributed worldwide (operated by IANA, Verisign, NASA, and others). These servers don't know the final answer — they just know who to ask next.

Full list of root servers → iana.org

The root server responds: "For .com domains, go talk to this TLD server."

Layer 2 — TLD Servers

The resolver contacts the TLD server for .com. Again, it doesn't have the final IP — but it knows which authoritative name server is responsible for bing.com.

.com delegation data → iana.org

Layer 3 — Authoritative Name Server

Finally, the resolver reaches the Authoritative Name Server for bing.com. This server holds the actual DNS records for the domain — and it returns the IP address.

The full journey looks like this:

Your Browser
    │
    ▼
Recursive Resolver  ──── checks cache ──► found? return it
    │ (cache miss)
    ▼
Root Server  ──────────────────────────► "ask the .com TLD server"
    │
    ▼
TLD Server (.com)  ────────────────────► "ask bing.com's name server"
    │
    ▼
Authoritative Name Server (bing.com)  ─► "the IP is 204.79.197.200"
    │
    ▼
Recursive Resolver caches the result
    │
    ▼
Your Browser connects to 204.79.197.200

Step 5: Caching Saves Everyone Time

Every response in that chain comes with a TTL (Time To Live) — a number in seconds that tells resolvers how long to cache the answer.

bing.com.   300   IN   A   204.79.197.200
               │
               └── TTL: cache this for 300 seconds (5 minutes)

Once the answer is cached at the Recursive Resolver level, subsequent queries from anyone using that resolver skip the entire walk. This is why DNS is fast at scale even though the hierarchy seems deep.

When a site's IP changes (e.g. migrating servers), admins lower the TTL beforehand so the old IP expires quickly everywhere.

Bonus: Common DNS Record Types

DNS isn't just about IP addresses. A domain can have multiple record types:

Record Purpose Example
A Domain → IPv4 address bing.com → 204.79.197.200
AAAA Domain → IPv6 address bing.com → 2620:1ec:c11::200
CNAME Alias to another domain www.bing.com → bing.com
MX Mail server for a domain bing.com → mail.bing.com
TXT Arbitrary text (SPF, DMARC, verification) "v=spf1 include:..."
NS Name servers for the domain bing.com → ns1.msft.net

As a developer, you'll interact with all of these — especially A, CNAME, MX, and TXT — whenever you deploy an app, configure email, or verify domain ownership.

A Word on Modern DNS: DoH and DoT

Traditional DNS queries travel in plain text — anyone on the network (your ISP, a coffee shop router) can see every domain you resolve. Two modern protocols address this:

  • DNS over HTTPS (DoH): Wraps DNS queries in HTTPS, making them indistinguishable from regular web traffic
  • DNS over TLS (DoT): Encrypts DNS on port 853

Both Chrome and Firefox support DoH natively. Cloudflare's 1.1.1.1 and Google's 8.8.8.8 support both. Worth enabling if privacy matters to your users or your app.

The Full Picture

Here's the complete DNS resolution flow in one view:

1. User types www.bing.com
2. Browser cache? → Hit: done. Miss: continue.
3. OS hosts file? → Hit: done. Miss: continue.
4. Recursive Resolver cache? → Hit: done. Miss: continue.
5. Root Server → points to .com TLD Server
6. TLD Server → points to bing.com Authoritative Server
7. Authoritative Server → returns 204.79.197.200
8. Resolver caches result (TTL)
9. Browser connects to 204.79.197.200
10. Page loads 

All of this typically completes in 20–120 milliseconds.

Wrapping Up

DNS is one of those invisible foundations that the entire web sits on. As a developer you'll hit it constantly — debugging propagation delays after a deploy, setting up custom domains, configuring email records, or hardening your app's privacy with DoH.

Understanding the hierarchy (Root → TLD → Authoritative) and the role of caching and TTLs takes a lot of the mystery out of those moments when "the DNS hasn't propagated yet."

Next time you type a URL, you'll know exactly what's happening in those milliseconds.

By Jino R Krishnan — Full Stack Developer