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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Troy Hunt's Blog
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
Cyberwarzone
Cyberwarzone
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
S
Securelist
L
Lohrmann on Cybersecurity
Security Latest
Security Latest
T
Threatpost
H
Heimdal Security Blog
W
WeLiveSecurity
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
TaoSecurity Blog
TaoSecurity Blog
A
About on SuperTechFans
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
量子位
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
AI
AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
Vercel News
Vercel News
C
Cyber Attacks, Cyber Crime and Cyber Security
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
大猫的无限游戏
大猫的无限游戏
Forbes - Security
Forbes - Security

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 Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How DNS Resolution Works: From `dig . NS` to Your Browser Loading Google
Janmejai Sin · 2026-05-09 · via DEV Community

Every time you type google.com into a browser, something remarkable happens in milliseconds — a global, distributed lookup system translates that human-readable name into a machine-readable IP address. No single server handles this. No central database stores it all.

This is DNS, and understanding how it works will make you a sharper developer, a better debugger, and a more informed system designer.

In this article, we'll use the dig command to inspect each layer of DNS resolution, building a mental model from the ground up.


Why Name Resolution Exists

Computers communicate using IP addresses — numerical labels like 142.250.195.78. Every server on the internet has one. But humans don't think in IP addresses. We think in names.

DNS (Domain Name System) solves this mismatch. It's the protocol and infrastructure that translates google.com142.250.195.78 so your browser knows where to send its request.

What makes DNS interesting (and worth understanding deeply) is its architecture:

  • Distributed — No single server holds all records. The system delegates responsibility across a global hierarchy.
  • Cached — Responses are stored at multiple levels to reduce latency.
  • Fault-tolerant — Each layer has multiple servers so no single failure breaks name resolution.

Meet dig — Your DNS Diagnostic Tool

dig (Domain Information Groper) is a command-line utility for querying DNS name servers. It ships with most Unix-like systems and is the go-to tool for DNS inspection.

Install it:

# macOS — usually pre-installed
dig --version

# Ubuntu / Debian
sudo apt install dnsutils

# CentOS / RHEL / Fedora
sudo yum install bind-utils

Enter fullscreen mode Exit fullscreen mode

Basic syntax:

dig [domain] [record_type] [options]

Enter fullscreen mode Exit fullscreen mode

Useful flags:

+short          # Concise output (just the answer)
+trace          # Full recursive trace from root down
@8.8.8.8        # Use a specific resolver
+norecurse      # Query the server directly without recursion

Enter fullscreen mode Exit fullscreen mode

Now let's use dig to walk the DNS hierarchy from top to bottom.


The DNS Hierarchy at a Glance

Before commands, here's the architecture we're navigating:

                         ┌─────────────┐
                         │   Root NS   │  ← dig . NS
                         │  (. zone)   │
                         └──────┬──────┘
                                │ "Ask .com servers"
                         ┌──────▼──────┐
                         │   TLD NS    │  ← dig com NS
                         │ (.com zone) │
                         └──────┬──────┘
                                │ "Ask Google's servers"
                         ┌──────▼──────┐
                         │ Auth NS     │  ← dig google.com NS
                         │(google.com) │
                         └──────┬──────┘
                                │ "Here's the IP"
                         ┌──────▼──────┐
                         │  A Record   │  ← dig google.com
                         │142.250.x.x  │
                         └─────────────┘

Enter fullscreen mode Exit fullscreen mode

DNS resolution is a top-down delegation chain. Each layer only knows how to refer you to the next. Let's explore each layer.


Layer 1: Root Name Servers — dig . NS

dig . NS

Enter fullscreen mode Exit fullscreen mode

The . (dot) is the DNS root zone — the very top of the entire DNS hierarchy.

Output:

;; ANSWER SECTION:
.    518400  IN  NS  a.root-servers.net.
.    518400  IN  NS  b.root-servers.net.
.    518400  IN  NS  c.root-servers.net.
...
.    518400  IN  NS  m.root-servers.net.

Enter fullscreen mode Exit fullscreen mode

There are 13 root name server names (a through m), but behind each name sit hundreds of physical servers globally — distributed via anycast routing. They're operated by a mix of organizations: ICANN, NASA, Verisign, Internet Systems Consortium, and others.

What they do: Root servers don't know the IP of google.com. They only know which servers are responsible for each Top-Level Domain (.com, .org, .net, .io, etc.).

The TTL of 518400 (6 days) tells you how stable these records are. Root server information almost never changes.

What NS records mean: An NS record points to the name server responsible for a DNS zone. Here, the root zone's NS records point to... the root servers themselves.


Layer 2: TLD Name Servers — dig com NS

dig com NS

Enter fullscreen mode Exit fullscreen mode

Now we query the name servers for the .com TLD.

Output:

;; ANSWER SECTION:
com.    172800  IN  NS  a.gtld-servers.net.
com.    172800  IN  NS  b.gtld-servers.net.
...
com.    172800  IN  NS  m.gtld-servers.net.

Enter fullscreen mode Exit fullscreen mode

These are Verisign's gTLD (Generic Top-Level Domain) servers — responsible for the entire .com namespace. Over 160 million domain names fall under their jurisdiction.

What they do: When a recursive resolver asks "Who is authoritative for google.com?", the gTLD servers respond with Google's name server hostnames. They do not know Google's IP address directly — they only know who to ask next.

System Design Insight: This delegation model is what allows DNS to scale to billions of domains. No single database. No central authority below the root. Responsibility is partitioned and delegated hierarchically.


Layer 3: Authoritative Name Servers — dig google.com NS

dig google.com NS

Enter fullscreen mode Exit fullscreen mode

Now we find the servers that actually own Google's DNS records.

Output:

;; ANSWER SECTION:
google.com.    21600  IN  NS  ns1.google.com.
google.com.    21600  IN  NS  ns2.google.com.
google.com.    21600  IN  NS  ns3.google.com.
google.com.    21600  IN  NS  ns4.google.com.

Enter fullscreen mode Exit fullscreen mode

These are Google's own authoritative name servers. Unlike the layers above them, these servers hold the actual DNS records:

Record Type Purpose
A IPv4 address
AAAA IPv6 address
MX Mail server
CNAME Canonical alias
TXT Verification, SPF, DKIM

Google runs its own infrastructure here. Many companies delegate this to DNS providers like Cloudflare, AWS Route 53, or Namecheap instead.

The TTL of 21600 (6 hours) is shorter than root/TLD records because these records can change — for example, when rotating infrastructure or updating configs.


The Full Resolution — dig google.com

dig google.com

Enter fullscreen mode Exit fullscreen mode

This is the query your browser ultimately needs: "What's the IP address for google.com?"

Output:

;; QUESTION SECTION:
;google.com.                    IN  A

;; ANSWER SECTION:
google.com.    300    IN  A    142.250.195.78

;; Query time: 12 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)

Enter fullscreen mode Exit fullscreen mode

Breaking It Down

Field Explanation
IN A Internet class, A (IPv4) record type
142.250.195.78 The actual IP address your browser connects to
300 TTL of 5 minutes — Google rotates IPs frequently for load balancing
Query time: 12 msec Fast because this was cached by 8.8.8.8
SERVER: 8.8.8.8 Google's public DNS answered this query

The Step-by-Step Flow (Uncached)

1. You type google.com
   ↓
2. Browser checks its DNS cache → miss
   ↓
3. OS checks /etc/hosts + system cache → miss
   ↓
4. Query sent to recursive resolver (8.8.8.8)
   ↓
5. Resolver asks Root NS: "Who handles .com?"
   ← "Ask a.gtld-servers.net"
   ↓
6. Resolver asks gTLD NS: "Who handles google.com?"
   ← "Ask ns1.google.com"
   ↓
7. Resolver asks ns1.google.com: "What's the A record for google.com?"
   ← "142.250.195.78, TTL 300"
   ↓
8. Resolver returns IP to your OS, caches it for 300 seconds
   ↓
9. Browser opens TCP connection to 142.250.195.78:443
   ↓
10. TLS handshake → HTTP request → Page loads ✓

Enter fullscreen mode Exit fullscreen mode

The whole chain (steps 5–7) typically completes in under 100ms.


Recursive Resolvers: The Unsung Heroes

A recursive resolver is the server that does the work of traversing the hierarchy on your behalf. When you configure DNS on your router or device, you're pointing to a recursive resolver.

Your Device
    │
    ▼
Recursive Resolver (8.8.8.8)
    │  Checks its cache first...
    │  If miss, walks the chain:
    ├──► Root NS      → referral
    ├──► TLD NS       → referral
    └──► Auth NS      → answer ✓
         Caches the result
         Returns to you

Enter fullscreen mode Exit fullscreen mode

Why Caching Matters

Every DNS response includes a TTL (Time to Live). Recursive resolvers cache answers for that duration before querying again.

Root NS TTLs      → ~2 days   (very stable)
TLD NS TTLs       → ~2 days   (very stable)
Auth NS TTLs      → hours     (occasionally updated)
A record TTLs     → seconds to hours (varies by domain)

Enter fullscreen mode Exit fullscreen mode

This is why DNS changes take time to "propagate" — resolvers worldwide are still serving cached responses until TTLs expire. When you update a DNS record, it's fully live for everyone only after the old TTL has expired everywhere.

Popular Public Recursive Resolvers

8.8.8.8      → Google Public DNS
1.1.1.1      → Cloudflare DNS (fastest globally, strong privacy)
9.9.9.9      → Quad9 (security-focused, blocks malware domains)
208.67.222.222 → OpenDNS (Cisco)

Enter fullscreen mode Exit fullscreen mode


Mapping dig Commands to DNS Stages

Here's a quick reference connecting each command to its role in the resolution flow:

dig . NS            # Stage 1: Who are the root name servers?
dig com NS          # Stage 2: Who manages the .com TLD?
dig google.com NS   # Stage 3: Who is authoritative for google.com?
dig google.com      # Stage 4: What's the actual IP address?

Enter fullscreen mode Exit fullscreen mode

Or run them all at once with the trace flag:

dig +trace google.com

Enter fullscreen mode Exit fullscreen mode

+trace makes dig itself walk the full hierarchy — from root to authoritative — and print every step. It's the most educational single command for understanding DNS resolution.


DNS in the Context of Real Browser Requests

When you visit https://google.com, DNS is step zero of the entire connection:

DNS Resolution       → ~1ms (cached) to ~100ms (fresh)
TCP Handshake        → ~10–50ms
TLS Handshake        → ~20–100ms
HTTP Request         → ~10–50ms
Page Render          → varies

Enter fullscreen mode Exit fullscreen mode

DNS is often the fastest part once cached — but a cold DNS lookup on first visit adds real latency. This is why modern browsers implement:

  • DNS prefetching — Pre-resolving domains found in <link rel="dns-prefetch"> or in page links
  • Connection pre-warming — Opening TCP/TLS connections before the user clicks
  • HTTP/3 with QUIC — Reduces connection overhead after DNS

And infrastructure teams use:

  • Low TTLs (60–300s) on CDN records to route users to the nearest edge node
  • DNS-based load balancing — Returning different IPs based on geography or health
  • DNS-over-HTTPS (DoH) — Encrypting DNS queries so ISPs can't snoop on which sites you visit

Quick Reference Card

# The resolution hierarchy
dig . NS                    # Root name servers
dig com NS                  # .com TLD name servers
dig google.com NS           # Authoritative name servers
dig google.com              # Final A record (IPv4)

# Other record types
dig google.com AAAA         # IPv6 address
dig google.com MX           # Mail servers
dig google.com TXT          # TXT records (SPF, DKIM, verification)
dig google.com CNAME        # Canonical name alias

# Diagnostic flags
dig +short google.com       # Just the IP
dig +trace google.com       # Full resolution trace from root
dig @1.1.1.1 google.com    # Force a specific resolver
dig +norecurse @a.root-servers.net google.com  # Direct root query

Enter fullscreen mode Exit fullscreen mode


Key Takeaways

  • DNS is hierarchical and distributed. No single server knows everything — each layer delegates to the next.
  • Root servers (. NS) point to TLD servers. There are 13 names, backed by hundreds of anycast servers.
  • TLD servers (e.g., com NS) point to authoritative servers for each domain.
  • Authoritative servers hold the actual records — A, MX, TXT, CNAME, etc.
  • Recursive resolvers traverse the full chain on your behalf and cache results using TTLs.
  • dig +trace is the fastest way to see the entire resolution chain in one command.

Resources


If this helped you build a clearer mental model of DNS, share it with your cohort. Understanding the infrastructure beneath the web makes you a better engineer at every layer of the stack.