Skip to content

DNS Fundamentals — The Internet's Phonebook

The Domain Name System (DNS) is one of the most important services in modern networking. Humans remember names such as google.com, github.com, and rebash.in, while computers communicate using IP addresses. DNS acts as the Internet's phonebook, translating human-friendly domain names into IP addresses that computers can use. Without DNS, users would have to remember numeric IP addresses for every website and service. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer must understand DNS fundamentals.


Learning Path

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

Difficulty: Beginner

Reading Time: 90 Minutes

Course Progress

Course: Networking Mastery

Module: DNS & DHCP

Lesson: 1 of 7


What You'll Learn

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

  • Understand DNS
  • Learn why DNS is needed
  • Understand domain names
  • Learn DNS hierarchy
  • Understand DNS servers
  • Learn Forward and Reverse DNS
  • Apply DNS concepts in enterprise and cloud environments

Prerequisites

Complete:

  • Module 1: Networking Fundamentals
  • Module 2: IPv4 Addressing
  • Module 3: IPv6
  • Module 4: Switching
  • Module 5: Routing

Why Learn DNS?

Imagine opening your browser and typing:

https://www.google.com

Does your computer know where Google is located?

No.

Your computer only understands:

142.250.183.110

DNS performs the translation.


What is DNS?

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

Domain Name


IP Address

Example:

google.com


142.250.x.x

Without DNS:

Remember Hundreds

of IP Addresses

❌ Impossible

DNS Analogy

Think of DNS as your phone contacts.

Instead of remembering:

9876543210

You save:

John

Similarly:

Instead of:

142.250.183.110

You use:

google.com

Domain Name

A domain name is the human-readable name of a network resource.

Examples:

google.com

amazon.com

github.com

rebash.in

Each domain corresponds to one or more IP addresses.


DNS Hierarchy

DNS follows a hierarchical structure.

.

(Root)


.com


google


www

Hierarchy:

Root


Top-Level Domain (TLD)


Second-Level Domain


Subdomain

Root Domain

At the top of DNS is:

.

Known as the:

Root Zone

Root servers direct queries toward the appropriate Top-Level Domain (TLD).


Top-Level Domain (TLD)

Examples:

.com

.org

.net

.edu

.gov

.in

TLDs organise the global DNS namespace.


Second-Level Domain

Example:

google.com

Here:

google


Second-Level Domain

Subdomain

Example:

mail.google.com

Subdomain:

mail

Organisations create subdomains for different services.

Examples:

api.company.com

dev.company.com

docs.company.com

Fully Qualified Domain Name (FQDN)

An FQDN uniquely identifies a host.

Example:

www.google.com

Contains:

  • Hostname
  • Domain
  • TLD

Technically, the complete FQDN ends with the root label:

www.google.com.

although the trailing dot is usually omitted.


DNS Servers

DNS is a distributed system.

Common server types include:

  • Recursive Resolver
  • Root Name Server
  • TLD Name Server
  • Authoritative Name Server

Each has a specific role in the resolution process.


Recursive Resolver

Usually provided by:

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

Responsibilities:

  • Receive client queries
  • Perform recursive lookups
  • Cache responses
  • Return the final answer

Root Name Server

Root servers know:

Where

.com

.org

.net

...

They direct queries to the correct Top-Level Domain servers.


TLD Name Server

Example:

.com

The TLD server knows which authoritative server manages:

google.com

Authoritative DNS Server

This server contains the official DNS records for a domain.

Example:

google.com


Authoritative Server


IP Address

Only authoritative servers provide the definitive answer for their zones.


Forward Lookup

Forward DNS:

Domain Name


IP Address

Example:

github.com


140.82.x.x

Reverse Lookup

Reverse DNS:

IP Address


Domain Name

Example:

8.8.8.8


dns.google

Reverse lookups use special PTR records, which will be covered in the next lesson.


DNS Cache

To improve performance:

First Lookup


Store Answer


Future Requests


Cache

Benefits:

  • Faster Resolution
  • Lower Network Traffic
  • Reduced DNS Server Load

DNS Workflow

User enters:

www.example.com

Workflow:

Browser


DNS Resolver


Root Server


TLD Server


Authoritative Server


IP Address


Browser Connects

Enterprise Example

Company:

Employees


Internal DNS


Internal Servers

Internal DNS resolves:

  • File Servers
  • Databases
  • Internal Applications
  • Authentication Servers

without exposing them to the Internet.


Cloud Perspective

Cloud platforms provide managed DNS services for:

  • Public Websites
  • Private Networks
  • Load Balancers
  • Kubernetes Clusters
  • Hybrid Cloud

DNS enables services to remain reachable even when IP addresses change.


Kubernetes Perspective

Kubernetes includes an internal DNS service.

Examples:

frontend.default.svc.cluster.local

Pods communicate using service names instead of IP addresses.

This allows applications to continue working even if Pod IPs change.


Linux Perspective

Display DNS servers.

cat /etc/resolv.conf

Query DNS.

dig google.com

Alternative:

nslookup google.com

Display host information.

host google.com

Check DNS resolution.

getent hosts google.com

Advantages of DNS

  • Human-Friendly Names
  • Centralised Name Resolution
  • Scalable
  • Distributed Architecture
  • High Availability
  • Easy Resource Management

Limitations

  • DNS server failures can affect name resolution
  • Incorrect records can redirect traffic
  • DNS propagation takes time after changes
  • DNS cache may temporarily return outdated information

Hands-on Lab

Task 1

Display configured DNS servers.

cat /etc/resolv.conf

Task 2

Resolve a domain.

dig google.com

Task 3

Resolve using host.

host github.com

Task 4

Resolve using nslookup.

nslookup rebash.in

Task 5

Perform a reverse lookup.

dig -x 8.8.8.8

Task 6

Draw the DNS hierarchy showing:

  • Root
  • TLD
  • Domain
  • Subdomain

Task 7

Draw the DNS resolution workflow from browser to authoritative server.


Task 8

Compare:

  • Forward Lookup
  • Reverse Lookup

Linux Commands

Command Purpose
cat /etc/resolv.conf Display configured DNS servers
dig domain.com Query DNS records
dig -x <IP> Perform reverse DNS lookup
nslookup domain.com Resolve domain names
host domain.com Display DNS information
getent hosts domain.com Query system name resolution

Common Mistakes

❌ Assuming DNS stores website content.

✅ DNS only maps names to addresses.


❌ Confusing a domain name with an IP address.

✅ Domains are names; IPs identify hosts.


❌ Forgetting DNS caching.

✅ Cached results may not reflect recent changes.


❌ Ignoring reverse DNS.

✅ Reverse lookups are important for troubleshooting and some services.


❌ Editing /etc/resolv.conf without understanding system management.

✅ Use the appropriate network management tool on your Linux distribution if the file is automatically generated.


Best Practices

  • Use reliable DNS resolvers.
  • Configure multiple DNS servers for redundancy.
  • Monitor DNS latency and availability.
  • Keep DNS records accurate and up to date.
  • Enable DNS caching where appropriate.
  • Protect authoritative DNS servers from unauthorised changes.

Interview Questions

Beginner

  1. What is DNS?
  2. Why is DNS needed?
  3. What is a domain name?
  4. What is a DNS server?

Intermediate

  1. Explain the DNS hierarchy.
  2. What is the difference between recursive and authoritative DNS servers?
  3. Explain forward and reverse DNS lookups.
  4. What is DNS caching?

Architect Level

  1. Design a highly available enterprise DNS architecture.
  2. Explain DNS in hybrid cloud environments.
  3. How would you troubleshoot slow or failed DNS resolution?

Summary

In this lesson, you learned:

  • DNS fundamentals
  • Domain Names
  • DNS Hierarchy
  • Root Servers
  • TLD Servers
  • Recursive Resolvers
  • Authoritative DNS Servers
  • Forward Lookup
  • Reverse Lookup
  • DNS Caching
  • Linux DNS Commands

DNS is one of the most fundamental services on the Internet. It allows humans to use meaningful names instead of numeric IP addresses while providing a scalable, distributed, and highly available naming system for enterprise, cloud, and Internet services.


Key Takeaways

  • DNS translates domain names into IP addresses.
  • DNS follows a hierarchical architecture.
  • Recursive resolvers perform lookups on behalf of clients.
  • Authoritative servers store the official DNS records for a domain.
  • Forward lookups resolve names to IPs; reverse lookups resolve IPs to names.
  • DNS caching improves performance and reduces network traffic.

What's Next?

DNS Records

In the next lesson, you'll learn about DNS Records.

You'll explore:

  • A Records
  • AAAA Records
  • CNAME Records
  • MX Records
  • NS Records
  • TXT Records
  • PTR Records
  • SOA Records
  • SRV Records

By the end of the lesson, you'll understand the purpose of the most important DNS record types and how they are used to build modern Internet, enterprise, and cloud services.