Skip to content
What is DNS — Simple Explanation with Examples

What is DNS — Simple Explanation with Examples

DodaTech Updated Jun 20, 2026 6 min read

DNS (Domain Name System) translates human-readable domain names into IP addresses, enabling browsers to load internet resources without memorizing numeric addresses.

In this guide, you’ll understand how DNS works behind the scenes, how to troubleshoot DNS issues, and how to configure DNS records for your own domains. This knowledge is essential for web developers, system administrators, and anyone who manages websites.

Why DNS Exists — The Problem It Solves

Computers communicate using IP addresses — numbers like 142.250.190.46. Humans are terrible at remembering numbers. We remember names like “google.com.”

DNS bridges this gap. When you type a domain name into a browser, DNS finds the corresponding IP address so your computer can connect to the right server. Without DNS, you’d need to memorize an IP address for every website you visit.

The Scaling Problem

In the early days of the internet (1980s), a single file called HOSTS.TXT mapped all domain names to IP addresses. As the internet grew, this became impossible to maintain. DNS was created in 1983 as a distributed, hierarchical system that could scale to millions of domains.

The Analogy — Phone Book

DNS is like a phone book for the internet. You look up a person’s name (domain) to find their phone number (IP address).

But it’s more like a distributed phone book system:

  1. You first check your personal contacts (local cache).
  2. If not there, you ask a directory assistance operator (your ISP’s resolver).
  3. They check their regional directory (root/TLD servers).
  4. Eventually, they find the specific listing (authoritative nameserver).

DNS Hierarchy

DNS is organized as a tree-like hierarchy:

Root (.)
  ├── .com (TLD)
  │   ├── example.com (authoritative)
  │   └── google.com (authoritative)
  ├── .org (TLD)
  │   └── wikipedia.org (authoritative)
  └── .io (TLD)
      └── github.io (authoritative)

Root Servers

13 logical root server clusters (hundreds of physical machines) that know where all TLD nameservers are. They don’t answer domain lookups directly — they redirect to the right TLD server.

TLD Servers

Top-Level Domain servers handle .com, .org, .net, .io, country codes like .uk, .jp, and new TLDs like .dev, .app.

Authoritative Nameservers

The final authority for a domain. They hold the actual DNS records (A, CNAME, MX, etc.) and return the IP address for the requested domain.

How DNS Resolution Works (Step by Step)

When you type example.com in your browser:

Browser
  │ 1. Checks local DNS cache
  │ 2. Asks recursive resolver (ISP or 8.8.8.8)
  ▼
Recursive Resolver
  │ 3. Asks root server: "Who handles .com?"
  ◄── Root: "Ask the .com TLD server at 192.0.34.162"
  │ 4. Asks .com TLD: "Who handles example.com?"
  ◄── .com TLD: "Ask ns1.example.com"
  │ 5. Asks ns1.example.com: "What is the IP of example.com?"
  ◄── ns1.example.com: "93.184.216.34"
  │ 6. Returns IP to browser
  ▼
Browser connects to 93.184.216.34:80

Total time: typically 10–100ms for a cold lookup. Subsequent lookups are faster due to caching.

DNS Record Types

RecordPurposeExample
AMaps domain to IPv4 addressexample.com → 93.184.216.34
AAAAMaps domain to IPv6 addressexample.com → 2606:2800:220:1:248:1893:25c8:1946
CNAMEAlias — maps one domain to anotherwww.example.com → example.com
MXMail exchange — directs email@ → mail.example.com (priority 10)
TXTText data (SPF, DKIM, verification)v=spf1 include:_spf.google.com ~all
NSAuthoritative nameserverexample.com → ns1.example.com
SOAStart of Authority — zone metadataSerial, refresh, retry, expiry

Using dig and nslookup

# Basic A record lookup
dig example.com

# Short output
dig example.com +short
# Output: 93.184.216.34

# Lookup specific record type
dig example.com MX +short
# Output: 0 .  (no MX records)

# Trace the full resolution path
dig example.com +trace

# Using nslookup (simpler)
nslookup google.com
# Output:
# Server:   192.168.1.1
# Address:  192.168.1.1#53
# Non-authoritative answer:
# Name:     google.com
# Address:  142.250.190.46

TTL and DNS Propagation

TTL (Time To Live) tells DNS resolvers how long to cache a record before checking for updates.

# Check TTL of a record
dig example.com | grep "IN A"
# Output: example.com. 86400 IN A 93.184.216.34
# TTL is 86400 seconds = 24 hours

When you change a DNS record, propagation time depends on the TTL:

  • Short TTL (300s): Changes propagate in 5 minutes. Good for dynamic setups.
  • Long TTL (86400s): Changes take 24 hours. Good for stable records.

Pro tip: Lower the TTL before making changes, then raise it after propagation.

Security — DNSSEC

DNSSEC (DNS Security Extensions) adds cryptographic signatures to DNS records so resolvers can verify they haven’t been tampered with.

# Check if a domain has DNSSEC
dig example.com +dnssec

# Look for the "ad" flag (authenticated data)
dig com SOA +multi

Without DNSSEC, attackers can perform DNS spoofing or cache poisoning — redirecting users to fake websites even when they type the correct domain.

Common Use Cases

1. Website hosting

Point example.com to your web server’s IP with an A record. Create a CNAME for www to redirect to the root domain.

2. Email delivery

MX records tell the internet where to deliver email for your domain. SPF and DKIM (TXT records) prevent spoofing.

3. Load balancing with DNS round-robin

Multiple A records for the same domain distribute traffic across servers:

example.com → 203.0.113.1
example.com → 203.0.113.2
example.com → 203.0.113.3

4. CDN routing

CDNs use DNS to direct users to the nearest edge server. A single domain may resolve to different IPs depending on the user’s location.

5. Internal network services

Private DNS zones map internal hostnames (db.internal.company.com) to private IPs that aren’t accessible from the internet.

FAQ

What happens if DNS goes down?

You can’t access websites by domain name. If your browser has nothing cached, every domain fails to load unless you use the IP address directly.

How long does DNS take to update?

Depends on the TTL of the records being changed and the upstream resolvers. Short TTLs (5 min) update quickly. Long TTLs (24+ hours) take a full day. Some ISPs ignore TTLs.

What is the difference between A and CNAME records?

An A record points a domain directly to an IP. A CNAME points a domain to another domain (which then resolves via an A record). CNAMEs cannot coexist with other records on the same name.

What is 8.8.8.8?

Google’s public DNS resolver. Anyone can use it for free. Alternatives include Cloudflare’s 1.1.1.1 and Quad9’s 9.9.9.9.

Is DNS secure by default?

No. Standard DNS sends queries in plaintext (UDP). If you need privacy, use DNS over HTTPS (DoH), DNS over TLS (DoT), or DNSSEC for data integrity.

Related Terms

HTTPS, CDN, Load Balancing, TLS/SSL, Caching

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro