DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
  1. Home
  2. Articles
  3. Frontend Engineering
  4. Understanding DNS: How Domain Resolution Actually Works
XLinkedInReddit
MediumFrontend Engineering

Understanding DNS: How Domain Resolution Actually Works

D
DevPrep Team
February 10, 2026·1 min read·0
Table of Contents
  • The Resolution Flow
  • DNS Record Types
  • Performance Optimization
  • TTL (Time to Live)
  • Common Issues

Every web request starts with DNS. Understanding the resolution process helps you optimize performance and debug network issues.

The Resolution Flow

  1. Browser Cache: Checks if it already knows the IP (TTL-based)
  2. OS Cache: Checks the operating system's DNS cache
  3. Router Cache: Some routers cache DNS responses
  4. ISP Recursive Resolver: Your ISP's DNS server
  5. Root Name Server: Directs to TLD server (.com, .org)
  6. TLD Name Server: Directs to authoritative server
  7. Authoritative Name Server: Returns the actual IP address

DNS Record Types

TypePurposeExample
AIPv4 addressexample.com → 93.184.216.34
AAAAIPv6 addressexample.com → 2606:2800:220:1:...
CNAMEAlias to another domainwww.example.com → example.com
MXMail serverexample.com → mail.example.com
TXTText data (SPF, DKIM)v=spf1 include:_spf.google.com
NSName serverexample.com → ns1.cloudflare.com

Performance Optimization

<!-- DNS Prefetch: resolve domain early -->
<link rel="dns-prefetch" href="//api.example.com">
<link rel="dns-prefetch" href="//cdn.example.com">
<link rel="dns-prefetch" href="//fonts.googleapis.com">

<!-- Preconnect: DNS + TCP + TLS handshake -->
<link rel="preconnect" href="https://api.example.com" crossorigin>

<!-- Use preconnect for critical origins, dns-prefetch for others -->

TTL (Time to Live)

Each DNS record has a TTL in seconds. Lower TTL = more DNS lookups but faster failover. Higher TTL = fewer lookups but slower propagation of changes.

// Typical TTLs
A record: 300s (5 min) for dynamic content
A record: 86400s (24h) for static content  
CNAME: 3600s (1h)

Common Issues

  • DNS propagation delay: After changing records, old values persist in caches until TTL expires
  • DNS over HTTPS (DoH): Encrypts DNS queries. Chrome and Firefox support it. Prevents ISP snooping.
  • Split-horizon DNS: Different answers for internal vs external queries. Common in corporate networks.

Related Articles

MediumFrontend Engineering

System Design #12: Design a Multi-Step Form Wizard

7 min read
MediumFrontend Engineering

Mastering Senior-Level JavaScript Interview Concepts

2 min read
MediumFrontend Engineering

System Design #9: Design a Collaborative Text Editor

9 min read

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first to comment.

Table of Contents

  • The Resolution Flow
  • DNS Record Types
  • Performance Optimization
  • TTL (Time to Live)
  • Common Issues

Series

View all Frontend Engineering articles →

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.