Skip to main content

DNS – The Silent Hero of the Internet Backbone

What is DNS? — Beginner Friendly Guide

๐Ÿ”Ž What Is DNS?

DNS (Domain Name System) is the phonebook of the Internet. It translates human-friendly names like google.com into IP addresses so devices can find each other.

DNS diagram
Diagram: DNS (Domain Name System)

Why DNS is the Silent Hero of the Internet

  • You type google.com
  • Your device needs the IP address (like 142.250.183.14)
  • DNS translates the name → IP automatically

When DNS fails:

  • Websites break
  • Apps stop responding
  • Emails fail
  • VPN & authentication can break

Fun fact: 70–80% of initial network failures trace back to DNS.

How DNS Works (Very Simple)

  1. You request a website
  2. Your resolver receives the request
  3. If not cached, it follows this chain:

Root → TLD → Authoritative → IP returned

Types of DNS Servers

1️⃣ Recursive Resolver

  • This is the first DNS server your device talks to.
  • It does all the hard work of finding the final IP address for you.
  • Stores (caches) answers so the next lookup is faster.
  • Examples: Google DNS (8.8.8.8), Cloudflare (1.1.1.1), Quad9 (9.9.9.9)

2️⃣ Authoritative DNS Server

This is the DNS server that holds the real, original DNS records for a domain. Whenever someone looks up a domain, this server provides the final and correct answer.

  • Stores official DNS records like A, AAAA, MX, CNAME, TXT, NS, SOA.
  • Doesn’t perform searching — it simply answers with what it already knows.
  • Owned by the domain’s hosting provider or where the DNS zone is configured.
  • Two types:
    • Primary (Master) Server — where the zone file is created and managed.
    • Secondary (Slave) Server — a read-only copy for redundancy and speed.
  • Without an authoritative server, your domain won’t resolve because no system would know your IP address.
  • Examples: Cloudflare DNS hosting, Route53, GoDaddy DNS, Namecheap DNS, DigitalOcean DNS.

3️⃣ Root DNS Servers

  • These are the “top-most” DNS servers — the starting point of the entire DNS hierarchy.
  • They don’t give IP addresses; instead, they guide your resolver to the correct TLD server.
  • There are 13 main root server names (A–M), but each has hundreds of global mirror servers.
  • They ensure global stability and help direct DNS traffic efficiently.

4️⃣ TLD (Top-Level Domain) Servers

  • These servers manage domain extensions such as .com, .in, .net, .org, etc.
  • They don’t store full DNS records — only tell the resolver which authoritative server holds the domain’s actual records.
  • Example: For google.com, the TLD server for .com points you to Google’s authoritative DNS server.
  • Run by registries like Verisign (.com, .net), NIXI (.in), PIR (.org) and others.

5️⃣ Caching DNS Servers

  • These servers store DNS answers temporarily to speed up future lookups (using TTL timers).
  • Reduce Internet traffic and make browsing much faster.
  • If they already have the answer in cache → reply instantly without contacting other DNS servers.
  • Examples: ISP DNS servers, corporate DNS servers, and public DNS resolvers.

Types of DNS Queries

1️⃣ Recursive Query

In a recursive query, the client (usually your computer or application) asks a DNS resolver to provide a complete answer — the IP address corresponding to a domain name. The resolver takes full responsibility to query other DNS servers on behalf of the client until it finds the final answer. If it cannot find an answer, it returns an error.

  • Client sends domain request to recursive resolver.
  • Resolver queries root, TLD, and authoritative servers as needed.
  • Resolver returns the final IP to the client.
  • Example: Your browser asks Google DNS for example.com, and Google DNS resolves it completely.

2️⃣ Iterative Query

In an iterative query, the DNS resolver does not find the final answer itself. Instead, it returns the best possible referral to another DNS server. The client or another resolver then continues the query process step by step until it reaches the authoritative server.

  • Client asks a resolver for a domain.
  • Resolver responds with the address of the next DNS server to query.
  • The process repeats until an authoritative server provides the IP address.
  • Example: Your resolver asks the root server for example.com, root points to the TLD server, TLD points to authoritative server.

3️⃣ Non-Recursive Query

In a non-recursive query, the DNS resolver already has the answer in its cache and returns it immediately to the client. This is the fastest type of query because no additional lookups are needed.

  • Client asks the resolver for a domain it has cached.
  • Resolver immediately returns the IP address from its cache.
  • Example: Accessing google.com right after visiting it — the resolver already knows the IP.

๐Ÿงพ Common DNS Record Types

RecordPurpose
ADomain → IPv4 address
AAAADomain → IPv6 address
CNAMEAlias domain pointer
MXMail exchange server
TXTVerification & policies (SPF, DKIM)
NSNameserver records
SRVService discovery
PTRReverse lookup

๐ŸŒ Popular Public DNS Servers

Provider IPv4 IPv6 Notes
Google DNS 8.8.8.8
8.8.4.4
2001:4860:4860::8888 Fast & reliable
Cloudflare 1.1.1.1
1.0.0.1
2606:4700:4700::1111 Privacy-focused
Quad9 9.9.9.9 2620:fe::9 Security filtering
OpenDNS 208.67.222.222 2620:0:ccc::2 Cisco-backed
CleanBrowsing 185.228.168.9 2a0d:2a00:1::2 Family-safe DNS

How to Configure DNS on Your System

Windows 10 / 11

  1. Open Control PanelNetwork and InternetNetwork and Sharing Center.
  2. Click Change adapter settings on the left panel.
  3. Right-click your active network adapter (Wi-Fi or Ethernet) and select Properties.
  4. Select Internet Protocol Version 4 (TCP/IPv4)Properties.
  5. Choose Use the following DNS server addresses and enter:
Preferred DNS: 1.1.1.1
Alternate DNS: 8.8.8.8
  1. Click OK to save changes.
  2. Flush the DNS cache by opening Command Prompt as administrator and running:
    ipconfig /flushdns

macOS (Ventura / Sonoma)

  1. Open System SettingsNetwork.
  2. Select your active network (Wi-Fi or Ethernet) → DetailsDNS.
  3. Click the + button to add DNS servers:
1.1.1.1
8.8.8.8
  1. Click Apply to save changes.
  2. Flush the DNS cache in Terminal:
sudo dscacheutil -flushcache

Linux (Ubuntu / Debian / RHEL)

  1. Edit the DNS configuration file directly: /etc/resolv.conf, or use your network manager.
  2. Add the following lines:
nameserver 1.1.1.1
nameserver 8.8.8.8
  1. If using NetworkManager, update DNS via terminal:
nmcli dev show | grep DNS
nmcli con mod <connection_name> ipv4.dns "1.1.1.1 8.8.8.8"
nmcli con up <connection_name>

How to Validate DNS is Working

After configuring DNS, you should verify that it is resolving domain names correctly. Here are common checks:

1. Ping a Domain

ping google.com

If it resolves to an IP address, DNS is working.

2. Use nslookup

nslookup google.com

This shows which DNS server responded and the resolved IP address.

3. Use dig (Linux / macOS)

dig google.com
dig google.com +trace
dig google.com @1.1.1.1

These commands show detailed DNS resolution steps, including which servers are queried.

4. Test DNS Port Connectivity

nc -u -v 8.8.8.8 53

This tests if your system can reach the DNS server over UDP port 53.

5. Flush DNS Cache

  • Windows: ipconfig /flushdns
  • macOS: sudo dscacheutil -flushcache
  • Linux (systemd): sudo systemd-resolve --flush-caches

๐Ÿ“ก Which Port Does DNS Use?

Query Type Protocol Port
Regular LookupUDP53
Zone TransferTCP53
Large Responses / DNSSECTCP53

Extra Insights

  • DNS issues commonly cause Microsoft 365 & VPN failures.
  • Never mix internal & public DNS.
  • Use fallback DNS always.
  • Monitor DNS latency regularly.

๐Ÿ”š Conclusion

DNS Is Critical (Don't Underestimate It)

DNS is the bedrock of the modern Internet. It silently resolves billions of queries every day and converts human-friendly names into machine-friendly IP addresses. When DNS breaks — even if all backend systems are healthy — websites fail, authentication breaks, VPN stops working, and apps become unreachable.

Why You Should Care:

  • Most “network down” issues start with DNS.
  • Correct DNS configuration improves speed, reliability, and security.
  • DNS caching saves time, bandwidth, and accelerates browsing.
  • Modern services like Microsoft 365 and SaaS apps heavily depend on DNS.

Whether you’re a beginner or an experienced engineer, understanding DNS gives you a powerful advantage in troubleshooting, optimizing networks, and ensuring smooth Internet experience.

Remember: DNS is not just a lookup – it’s the backbone of how the Internet knows where everything is.

Popular posts from this blog

OSI Model vs TCP/IP Model - Beginner Friendly Networking Guide

OSI vs TCP/IP Models Networking can feel intimidating, but understanding how devices communicate becomes much easier with the OSI model and TCP/IP model . These models break down the process of sending data into layers, each with a specific role. Let’s simplify it! ๐ŸŒ๐Ÿ’ก What Is the OSI Model? The OSI (Open Systems Interconnection) model is a conceptual framework for networking. Think of it as a step-by-step recipe for sending data across networks. With 7 distinct layers , it makes troubleshooting, designing, and understanding networks much easier. OSI Layers with Icons & Real-Life Examples Application Layer (Layer 7 ๐Ÿ“ฑ) Purpose: Interface with apps and user services. Example: Browsing websites, checking emails, streaming Netflix. Presentation Layer (Layer 6 ๐Ÿ—œ️๐Ÿ”’) Purpose: Data formatting, encryption, compression. Example: TLS/SSL encryption, ZIP files. Session Layer (Layer 5 ๐ŸŽฅ๐Ÿ“ž) Purpose: Manages s...

What Are Port Numbers in Networking?

In networking, a port number acts like a door or channel inside a device that allows specific types of data to enter or exit. While the IP address tells you where data should go, the port number tells you which application should receive it. Think of it like this: IP Address = Apartment Building Port Number = Apartment Number ๐ŸŽฏ Why Are Port Numbers Important? ๐ŸŸฆ 1. They Keep Apps Talking to the Right Services Your web browser, email app, games, and video calls all use different ports. ๐Ÿ” 2. Essential for Security & Firewalls Firewalls allow or block traffic based on port numbers . Open ports = entry points Closed ports = safer system ๐Ÿ›  3. Helps Troubleshoot Network Issues If an app isn’t loading, the port is often the issue. ๐Ÿง  Real-Life Examples of Port Numbers Everyday Activity Port Number Why It's Used Browsing websites 80 / 443 HTTP/HTTPS Online banking/login 443 Secure HTTPS WhatsApp Web 5222 / 443 Messaging protocol Email ...

DHCP Demystified: The Easiest Way to Learn How Devices Get IPs

  If you have ever connected your phone, laptop, or any device to a home network, office LAN, or Wi-Fi , and everything just started working without you entering any IP settings, you have already experienced the magic of DHCP. It quietly handles the job of giving your device the right network details so you can get online instantly. It’s one of those behind-the-scenes technologies that keeps networks running smoothly while removing the need for manual configuration. Let’s break it down in a simple, human way. What Exactly Is DHCP? DHCP stands for Dynamic Host Configuration Protocol. It’s a network service that automatically assigns important network details to devices—like IP address, subnet mask, default gateway, and DNS servers. Without DHCP, every device would need these values typed in manually. Imagine doing that for hundreds of users in an office! DHCP makes life easier by automating all of it. ๐Ÿ”Œ  DHCP Port Numbers (Very Important!) UDP Port 67 → DHCP Server UDP P...
Message here