What Is DNS? Explained Simply (2026)
DNS is the phonebook of the internet. Here's what it actually does, how it works step by step, and why DevOps engineers need to understand it deeply.
Every time you open a website, DNS runs before anything else. Understanding it will help you debug half the networking issues you'll ever face.
The Simple Explanation
When you type google.com in your browser, your computer needs to find out which IP address that corresponds to. Computers talk to each other using IP addresses (like 142.250.80.46), not human-friendly names.
DNS (Domain Name System) is the system that converts google.com ā 142.250.80.46.
It's like a phonebook ā you look up a name, get a number.
How a DNS Lookup Actually Works
When you type devopsboys.com:
-
Your browser checks its cache ā has it seen this recently? If yes, use cached IP.
-
Your OS checks its cache ā same thing, slightly larger cache.
-
Your OS checks
/etc/hosts(Linux/Mac) orC:\Windows\System32\drivers\etc\hosts(Windows) ā static overrides. -
Your resolver (DNS server) gets asked ā usually your ISP's server, or 8.8.8.8 (Google), or 1.1.1.1 (Cloudflare). This is your recursive resolver.
-
Recursive resolver asks the Root servers ā there are 13 root server groups worldwide. They know where to find
.comnameservers. -
Root server responds: "ask the .com TLD nameservers"
-
Recursive resolver asks the .com TLD nameservers ā they know where
devopsboys.com's nameservers are. -
TLD nameserver responds: "ask ns1.vercel-dns.com" (the authoritative nameserver for devopsboys.com)
-
Recursive resolver asks the authoritative nameserver ā this server has the actual records.
-
Authoritative nameserver responds with the IP address
-
Recursive resolver caches the result and returns it to your browser
-
Your browser connects to the IP
This entire process takes 20ā200ms for uncached lookups, and milliseconds for cached ones.
DNS Record Types
A Record ā maps a hostname to an IPv4 address
devopsboys.com ā 76.76.21.21
AAAA Record ā maps a hostname to an IPv6 address
devopsboys.com ā 2606:4700::6810:1505
CNAME Record ā maps a hostname to another hostname (alias)
www.devopsboys.com ā devopsboys.com
Important: CNAMEs can't be used at the apex domain (devopsboys.com itself) ā only subdomains.
MX Record ā mail server for a domain
devopsboys.com ā mail.google.com (priority 10)
TXT Record ā arbitrary text, used for domain verification and SPF/DKIM email records
devopsboys.com ā "v=spf1 include:_spf.google.com ~all"
NS Record ā nameservers responsible for the domain
devopsboys.com ā ns1.vercel-dns.com, ns2.vercel-dns.com
SOA Record ā Start of Authority ā metadata about the zone
TTL ā Time to Live
Every DNS record has a TTL (in seconds). This tells resolvers how long to cache the answer.
devopsboys.com 300 IN A 76.76.21.21
TTL = 300 means: cache this for 300 seconds (5 minutes).
Why TTL matters:
- Low TTL (60s): fast propagation when you change a record, but more DNS queries
- High TTL (86400s = 24h): fewer queries, but DNS changes take up to 24 hours to propagate worldwide
Before a major DNS change (domain migration, IP change), lower TTL to 60s first, wait for old TTL to expire, then make the change.
DNS in Kubernetes (CoreDNS)
Inside a Kubernetes cluster, DNS works differently. CoreDNS runs as a pod in kube-system and handles all in-cluster DNS.
Service discovery pattern:
# A service named "my-service" in namespace "my-namespace"
# is reachable at:
my-service.my-namespace.svc.cluster.local
# Short form (within same namespace):
my-service
# From a different namespace:
my-service.my-namespace# Test DNS inside a pod
kubectl run dns-test --image=busybox --restart=Never -- \
nslookup my-service.my-namespace.svc.cluster.local
# Check CoreDNS is running
kubectl get pods -n kube-system -l k8s-app=kube-dns
# Check CoreDNS config
kubectl get configmap -n kube-system coredns -o yamlUseful DNS Commands
# Look up A record
nslookup devopsboys.com
dig devopsboys.com
# Check what DNS server you're using
nslookup devopsboys.com 8.8.8.8 # force query to Google DNS
dig @1.1.1.1 devopsboys.com # force query to Cloudflare
# Check specific record types
dig devopsboys.com MX # mail records
dig devopsboys.com TXT # text records
dig devopsboys.com NS # nameservers
# Trace full resolution path
dig +trace devopsboys.com
# Reverse DNS (IP to hostname)
dig -x 76.76.21.21
# Check TTL on a record
dig devopsboys.com | grep -i ttlCommon DNS Problems DevOps Engineers Face
"Site not loading after DNS change" ā TTL hasn't expired. Wait for old TTL. Check propagation at dnschecker.org.
"Works on my machine, not in prod"
ā Different DNS servers. Your ISP may have stale cache. Use dig @8.8.8.8 to bypass local cache.
"Pod can't reach external service"
ā CoreDNS issue or egress DNS blocked. Run nslookup from inside the pod.
"DNS works for some pods, not others" ā CoreDNS resource limits ā it might be OOMKilling under high query load.
"Intermittent DNS failures" ā ndots setting in Kubernetes. Kubernetes appends cluster suffixes before trying external domains, causing extra failed lookups.
DNS in One Sentence
DNS converts human-friendly hostnames into IP addresses through a hierarchical distributed system ā and understanding it helps you debug half the networking problems you'll ever encounter.
If you can read dig output and understand TTL, you know enough DNS for most DevOps work.
Stay ahead of the curve
Get the latest DevOps, Kubernetes, AWS, and AI/ML guides delivered straight to your inbox. No spam ā just practical engineering content.
Related Articles
How to Migrate from Ingress-NGINX to Kubernetes Gateway API in 2026
Step-by-step guide to migrating from Ingress-NGINX to Kubernetes Gateway API. Includes YAML examples, implementation choices, testing strategy, and cutover plan.
How to Set Up Kubernetes Gateway API to Replace Ingress (2026 Guide)
The Kubernetes Ingress API is being replaced by the Gateway API. Here's a complete step-by-step guide to setting it up with Nginx Gateway Fabric and migrating from Ingress.
What is a Service Mesh? Explained Simply (No Jargon)
Service mesh sounds complicated but the concept is simple. Here's what it actually does, why teams use it, and whether you need one ā explained without the buzzwords.