Code Architecture

Reading Time 5 mins

Updated on Sat, 10 Jan 2026

Related Content

DNS Explained from a Computer Networks Perspective (With Real Examples)

When you type google.com into your `browser`, have you ever wondered:

That magic is done by DNS (Domain Name System) — one of the most fundamental concepts in Computer Networks.

info

baseDirectory is the folder Amplify will publish. <br/> 2. For CRA it's build/; for Next static exports it's out/; for Next SSR you typically publish the server artifacts (Amplify handles wiring).3Use caching to speed up builds (node_modules or package manager caches).  

In this article, we’ll explain DNS:

  • From a computer networks point of view

  • Using real-world examples

  • With simple flow diagrams

  • Without heavy jargon

By the end, DNS will feel obvious, not confusing.

What Is DNS? (Computer Networks Definition)

DNS (Domain Name System) is a distributed naming system that translates:

Loading...

Example:

Loading...

Computers communicate using IP addresses, not domain names. DNS acts like the internet’s phonebook.

Why DNS Is Needed (Real-Life Analogy)

Imagine calling a friend:

  • You remember their name

  • Your phone converts it to a number

  • The call connects

DNS does the same:

  • You type a domain name

  • DNS finds the IP address

  • Browser connects to the server

Where Does DNS Fit in Computer Networks?

DNS sits at the Application Layer of the OSI & TCP/IP models.

LayerRole
ApplicationDNS, HTTP, FTP
TransportTCP / UDP
NetworkIP
Data LinkEthernet
PhysicalWires, signals

📌 DNS mainly uses UDP port 53 (TCP is used for large responses or zone transfers)

Step-by-Step: What Happens When You Type a URL?

Let’s break it down step by step.

Example:

Loading...

Step 1: Browser Cache

The browser first checks:

“Have I already resolved this domain recently?”

If yes → done If no → continue

Step 2: OS Cache

Your operating system checks its local DNS cache.

Loading...

Step 3: Recursive DNS Resolver (ISP / Public DNS)

If not found locally, the request goes to a recursive resolver like:

  • Google DNS (8.8.8.8)

  • Cloudflare (1.1.1.1)

  • ISP DNS

Step 4: Root Name Server

The resolver asks:

“Who handles .com domains?”

Root server replies:

Loading...

Step 5: TLD Name Server (.com)

TLD server replies:

Loading...

Step 6: Authoritative Name Server

The authoritative server responds with the final IP address.

Loading...

This result is cached to speed up future requests.

DNS Resolution Summary (One Line)

Loading...

Common DNS Record Types (With Examples)

RecordPurposeExample
ADomain → IPv4example.com → 1.2.3.4
AAAADomain → IPv6example.com → ::1
CNAMEDomain → Domainwww → example.com
MXMail serverGmail routing
TXTVerification / securitySPF, DKIM
NSName serversRoute DNS

DNS in Real Applications (Practical View)

🌐 Websites

Loading...

🔗 APIs

Loading...

📧 Emails

DNS MX records decide where emails go

DNS and Caching (Why It’s Fast)

DNS uses TTL (Time To Live).

Example:

Loading...

Means:

  • Resolver can reuse the answer for 5 minutes

  • Reduces internet load

  • Speeds up browsing

DNS vs IP Address (Why Humans Need DNS)

IP AddressDNS
Hard to rememberEasy to remember
Changes oftenStable
Machine-friendlyHuman-friendly

DNS in Cloud & Modern Systems

In cloud systems, DNS becomes even more important.

Example with AWS:

  • Amazon Route 53

  • Traffic is routed to:

    • CloudFront

    • Load Balancer

    • API Gateway

DNS is the entry point of modern architectures.

Common DNS Mistakes Beginners Make

  • Thinking DNS = hosting

  • Expecting instant DNS changes (propagation delay)

  • Mixing A record & CNAME wrongly

  • Ignoring TTL impact

  • Not understanding authoritative vs recursive servers

Why DNS Is Important for Exams & Interviews

If you’re studying:

  • Computer Networks

  • System Design

  • Cloud Computing

DNS is a must-know topic.

Interviewers often ask:

“Explain what happens when you type google.com in a browser”

DNS is 50% of that answer.

Final Thoughts

DNS is not magic. It’s a well-organized, hierarchical, distributed system designed to scale for the entire internet.

Once you understand DNS:

  • Cloud makes sense

  • Load balancing makes sense

  • HTTPS & SSL make sense

DNS is the foundation of the web.

🔍 SEO Meta Description

Here are ready-to-use description options:

Learn DNS from a computer networks perspective with real-world examples. Understand how domain names resolve to IP addresses step by step.

🔹 Beginner-Friendly

DNS explained in simple terms from a computer networks perspective with real examples, diagrams, and easy step-by-step flow.

🔹 Exam / Interview Focused

Understand how DNS works in computer networks. Learn DNS resolution, records, caching, and real-world examples for exams and interviews.

⭐ Final Recommendation

Use this one: