Skip to content

DNS Resolution — How Domain Names Become IP Addresses

DNS Resolution is the process of converting a human-readable domain name (such as www.google.com) into an IP address that computers use to communicate. Every time you open a website, connect to an API, send an email, or access a cloud application, DNS resolution occurs behind the scenes. Although it usually completes in milliseconds, multiple DNS servers cooperate to provide the answer. Understanding DNS resolution is essential for Linux administrators, DevOps engineers, Cloud Architects, Platform Engineers, Site Reliability Engineers (SREs), and Network Engineers.


Learning Path

Networking Mastery → Module 6: DNS & DHCP → Lesson 3

Difficulty: Beginner

Reading Time: 100 Minutes

Course Progress

Course: Networking Mastery

Module: DNS & DHCP

Lesson: 3 of 7


What You'll Learn

After completing this lesson, you'll be able to:

  • Understand DNS Resolution
  • Learn Recursive and Iterative Queries
  • Understand DNS Query Flow
  • Learn DNS Caching
  • Understand Root, Top-Level Domain (TLD), and Authoritative Servers
  • Troubleshoot DNS Resolution
  • Apply DNS resolution in enterprise and cloud environments

Prerequisites

Complete:


Why Learn DNS Resolution?

Imagine opening:

https://www.github.com

Your browser only knows:

www.github.com

The network requires:

140.82.x.x

How does your computer discover the IP address?

The answer is:

DNS Resolution

What is DNS Resolution?

DNS Resolution is the process of translating:

Domain Name


IP Address

Example:

www.google.com


142.250.x.x

Once the IP address is known, the browser can establish a network connection.


DNS Resolution Workflow

The complete process:

User


Browser


Operating System


Recursive Resolver


Root Server


TLD Server


Authoritative Server


IP Address


Browser Connects

Step 1 — User Request

The user enters:

www.example.com

The browser asks:

What is the IP address?

Step 2 — Browser Cache

The browser first checks:

Browser DNS Cache

If found:

Return IP

✓ Done

No network request is required.


Step 3 — Operating System Cache

If the browser cache does not contain the answer:

Operating System


DNS Cache

Linux, Windows, and macOS all maintain DNS caches (directly or through resolver services).


Step 4 — Hosts File

Before contacting a DNS server, the operating system may check the local hosts file.

Linux:

/etc/hosts

Example:

192.168.1.20

webserver.local

If a matching entry exists:

Use Local Entry

Step 5 — Recursive Resolver

If the answer is still unknown:

Client


Recursive Resolver

The resolver performs the lookup on behalf of the client.

Common recursive resolvers include:

  • Enterprise DNS Servers
  • Internet Service Provider (ISP) DNS Servers
  • Public DNS Services

Step 6 — Root Server

The recursive resolver asks:

Where is

.com?

The Root Server replies:

Ask

.com TLD Server

The root server does not know the final IP address.


Step 7 — TLD Server

The resolver contacts:

.com

TLD Server

It asks:

Where is

example.com?

The TLD server responds with the authoritative name server.


Step 8 — Authoritative Server

The resolver contacts:

Authoritative Server

The server replies:

www.example.com


192.168.10.20

This is the official answer.


Step 9 — Cache the Result

The recursive resolver stores the answer according to the record's:

TTL

(Time To Live)

Future requests are much faster.


Step 10 — Browser Connects

The resolver returns:

192.168.10.20

The browser now opens a Transmission Control Protocol (TCP) connection to that IP address.


Recursive Query

A Recursive Query means:

Client


Resolver


Find Complete Answer

The resolver performs all remaining work.

Most client devices send recursive queries to their configured DNS resolver.


Iterative Query

An Iterative Query means:

Server


Referral


Next Server


Referral


Next Server

Each DNS server responds with the best information it has, often referring the requester to another DNS server.

Communication between DNS servers commonly uses iterative queries.


Recursive vs Iterative

Recursive Iterative
Client expects the final answer Server returns the best available information
Resolver performs the work Requester continues the search
Used by clients Commonly used between DNS servers

DNS Cache

Caching improves performance.

Example:

First request:

Lookup


Authoritative Server

Second request:

Resolver Cache


Immediate Response

Benefits:

  • Faster Lookups
  • Reduced Network Traffic
  • Lower Server Load

TTL (Time To Live)

Every DNS record has a TTL.

Example:

3600 Seconds

Meaning:

Cache

1 Hour

After the TTL expires, a fresh lookup is performed.


Negative Caching

DNS can also cache failed lookups.

Example:

unknown.example.com


NXDOMAIN

The failure may be cached for a limited time to reduce repeated unnecessary queries.


Forward Resolution

Hostname


IP Address

Uses records such as:

A

AAAA

Reverse Resolution

IP Address


Hostname

Uses:

PTR Records

Often used for:

  • Logging
  • Email Servers
  • Troubleshooting

Enterprise Example

Employee opens:

portal.company.com

Workflow:

Laptop


Corporate DNS


Internal DNS Zone


Application Server

The request never leaves the company's internal DNS infrastructure.


Cloud Perspective

Cloud providers use DNS resolution for:

  • Load Balancers
  • Virtual Machines
  • Containers
  • Kubernetes Services
  • Storage Services
  • Managed Databases

Managed DNS services automatically resolve resources even when underlying IP addresses change.


Kubernetes Perspective

Pods communicate using DNS.

Example:

frontend.default.svc.cluster.local

Instead of connecting directly to Pod IPs, applications resolve service names through the cluster DNS server.


Linux Perspective

Display configured DNS servers.

cat /etc/resolv.conf

Query a domain.

dig google.com

Trace the complete DNS resolution path.

dig +trace google.com

Display detailed lookup information.

nslookup google.com

Resolve a hostname.

host google.com

Check system name resolution.

getent hosts google.com

DNS Resolution Example

User requests:

www.rebash.in

Resolution path:

Browser


DNS Cache


Recursive Resolver


Root Server


.in TLD


Authoritative Server


IP Address


Website Opens

Advantages of DNS Resolution

  • Human-Friendly Access
  • Distributed Architecture
  • High Scalability
  • Fast Response Through Caching
  • Redundant Infrastructure
  • Automatic Name Translation

Common DNS Resolution Failures

  • DNS Server Unreachable
  • Incorrect DNS Records
  • Expired DNS Cache
  • Firewall Blocking DNS
  • Network Connectivity Problems
  • Incorrect Resolver Configuration

Hands-on Lab

Task 1

Display configured DNS servers.

cat /etc/resolv.conf

Task 2

Resolve a domain.

dig google.com

Task 3

Trace the complete DNS resolution path.

dig +trace google.com

Task 4

Perform a reverse lookup.

dig -x 8.8.8.8

Task 5

Display DNS information.

host github.com

Task 6

Compare:

  • Recursive Query
  • Iterative Query

Task 7

Draw the complete DNS resolution process from browser to authoritative server.


Task 8

Explain how DNS caching improves performance.


Linux Commands

Command Purpose
cat /etc/resolv.conf Display configured DNS servers
dig domain.com Perform DNS lookup
dig +trace domain.com Trace DNS resolution path
dig -x <IP> Reverse DNS lookup
host domain.com Resolve hostname
nslookup domain.com DNS lookup utility
getent hosts domain.com Query system name resolution

Common Mistakes

❌ Assuming the browser always contacts the authoritative server.

✅ The recursive resolver performs most lookups.


❌ Ignoring DNS caches.

✅ Cached results may explain unexpected responses.


❌ Confusing recursive and iterative queries.

✅ Recursive queries expect a final answer; iterative queries return referrals.


❌ Forgetting the hosts file.

✅ Check /etc/hosts before troubleshooting DNS servers.


❌ Assuming DNS always returns IPv4 addresses.

✅ Modern environments often return both A and AAAA records.


Best Practices

  • Configure multiple DNS resolvers for redundancy.
  • Use appropriate TTL values.
  • Monitor DNS response times.
  • Flush caches after major DNS changes when necessary.
  • Protect authoritative DNS servers.
  • Use dig +trace to troubleshoot complex resolution problems.

Interview Questions

Beginner

  1. What is DNS Resolution?
  2. What happens when you type a website address into a browser?
  3. What is a recursive resolver?
  4. What is a DNS cache?

Intermediate

  1. Explain recursive and iterative queries.
  2. What is the role of the root server?
  3. How does TTL affect DNS resolution?
  4. Why is caching important?

Architect Level

  1. Design a highly available enterprise DNS architecture.
  2. Explain DNS resolution in a hybrid cloud environment.
  3. How would you troubleshoot intermittent DNS resolution failures?

Summary

In this lesson, you learned:

  • DNS Resolution
  • Recursive Queries
  • Iterative Queries
  • Browser Cache
  • Operating System Cache
  • Hosts File
  • Recursive Resolvers
  • Root Servers
  • TLD Servers
  • Authoritative Servers
  • DNS Caching
  • TTL
  • Linux DNS Troubleshooting Commands

DNS resolution is the process that transforms human-readable domain names into IP addresses. By using recursive resolvers, hierarchical DNS servers, caching, and authoritative responses, DNS enables fast, reliable, and scalable communication across enterprise networks, cloud platforms, and the Internet.


Key Takeaways

  • DNS resolution converts domain names into IP addresses.
  • Browsers and operating systems check caches before contacting DNS servers.
  • Recursive resolvers perform lookups on behalf of clients.
  • Root, TLD, and authoritative servers work together to answer queries.
  • DNS caching improves speed and reduces network traffic.
  • dig +trace is one of the most valuable tools for understanding and troubleshooting DNS resolution.

What's Next?

DHCP Process

In the next lesson, you'll learn about DHCP Process.

You'll explore:

  • What DHCP is
  • DHCP Components
  • The DORA Process
  • DHCP Lease Lifecycle
  • DHCP Options
  • DHCP Reservations
  • Enterprise DHCP Architecture

By the end of the lesson, you'll understand how devices automatically obtain IP addresses and network configuration when joining a network.