Networking · 6 min read · May 18, 2026
What is DNS and How Does It Work?
DNS translates domain names like google.com into IP addresses your computer can use. Here's how the whole system works, step by step.
Every time you type a website address and press Enter, your computer has no idea where that website actually lives. It only understands IP addresses — numbers like 142.250.80.46. DNS is the system that bridges the gap between human-readable names and machine-readable numbers.
What is DNS?
DNS stands for Domain Name System. It's essentially the internet's phone book — a global, distributed database that maps domain names to IP addresses.
When you visit google.com, your computer asks a DNS server: "What's the IP address for google.com?" The DNS server replies with the IP, your browser connects to it, and the page loads. This entire process typically takes less than 50 milliseconds.
You can see your own IP address — the one your ISP assigns you — at IPLocator. Every device that participates in DNS has one.
How DNS Works — Step by Step
The DNS lookup process involves several components working together:
Step 1: Check the Local Cache
Before making any external requests, your computer checks its own DNS cache. If you visited google.com recently, the IP is already stored locally and no lookup is needed. This is why repeat visits are often faster.
Step 2: Ask the Recursive Resolver
If the answer isn't cached, your computer contacts a recursive resolver — typically operated by your ISP, or a public one like Google (8.8.8.8) or Cloudflare (1.1.1.1). This resolver acts on your behalf to find the answer.
Step 3: Root Name Server
If the resolver doesn't have the answer cached, it asks a root name server. There are 13 sets of root servers globally. They don't know the IP of google.com, but they know which servers handle .com domains.
Step 4: TLD Name Server
The resolver asks the TLD (Top-Level Domain) server for .com. It responds with the address of Google's authoritative name server.
Step 5: Authoritative Name Server
Finally, the resolver asks Google's authoritative name server — the definitive source for google.com records. It returns the actual IP address.
Step 6: Response Delivered
The resolver returns the IP to your computer, which caches it for future use. Your browser connects to the IP and loads the page.
The whole chain — resolver → root → TLD → authoritative — happens in milliseconds, entirely invisibly.
Want to perform a DNS lookup yourself? See how to find the IP address of any website →
DNS Record Types
DNS stores different types of records for each domain:
| Record | Purpose | Example |
|--------|---------|---------|
| A | IPv4 address | google.com → 142.250.80.46 |
| AAAA | IPv6 address | google.com → 2607:f8b0::4006 |
| CNAME | Alias to another domain | www → google.com |
| MX | Mail server address | Directs email delivery |
| NS | Name server | Who handles DNS for this domain |
| TXT | Text records | Used for SPF, DKIM, verification |
| PTR | Reverse lookup | IP → domain name |
The AAAA record is for IPv6 addresses — the newer addressing system that's gradually replacing IPv4.
What is a DNS Server?
A DNS server is any server that responds to DNS queries. There are several types:
- Recursive resolver — the one your device talks to directly (usually your ISP's)
- Root server — top of the DNS hierarchy, 13 sets worldwide
- TLD server — handles top-level domains (.com, .net, .org)
- Authoritative server — the final authority for a specific domain
Public DNS Servers
You can choose which DNS server your device uses. Popular options:
| Provider | DNS Server | Feature |
|----------|-----------|---------|
| Cloudflare | 1.1.1.1 | Fastest, privacy-focused |
| Google | 8.8.8.8 | Fast, reliable |
| Quad9 | 9.9.9.9 | Blocks malware domains |
| OpenDNS | 208.67.222.222 | Content filtering available |
Switching to a faster DNS server can noticeably speed up browsing — especially the initial connection to new sites.
DNS and Privacy
Standard DNS queries are sent in plain text. This means:
- Your ISP can see every domain you look up
- Anyone on your network can see your DNS traffic
- Your DNS provider builds a profile of your browsing habits
DNS over HTTPS (DoH) and DNS over TLS (DoT)
These protocols encrypt your DNS queries, preventing your ISP and network observers from seeing which domains you're resolving. Cloudflare's 1.1.1.1 and Google's 8.8.8.8 both support DoH. Modern browsers like Firefox and Chrome have DoH built in.
DNS Caching and TTL
Every DNS record has a TTL (Time to Live) — a number of seconds that resolvers should cache the answer. A TTL of 300 means cache the result for 5 minutes.
When websites change their IP address (like migrating to a new server), they lower their TTL in advance so the change propagates quickly. After the switch, they restore the TTL to normal.
What Happens When DNS Fails?
DNS failure is one of the most common causes of "the internet isn't working" — even when your actual connection is fine. Symptoms:
- Websites don't load but apps still work (apps sometimes cache IPs)
- You can ping an IP directly but not a domain name
- Browser shows "DNS_PROBE_FINISHED_NXDOMAIN" or similar errors
Quick fix: change your DNS server to 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google) in your network settings. This bypasses your ISP's DNS and often resolves the issue immediately.
DNS and Your IP Address
Your IP address and DNS are closely related — your IP tells websites where you are, and your DNS server knows every domain you visit. If you want full privacy, both need to be addressed: use a VPN to hide your IP, and use encrypted DNS (DoH/DoT) to hide your queries. Check your current IP at IPLocator to see what websites know about you right now.
CHECK YOUR IP NOW
See What Your IP Reveals →Related Articles