DNS (Domain Name System) translates human-readable domain names into IP addresses. When you type google.com, DNS figures out that means 142.250.185.78 and sends your request there.
Itβs the phone book of the internet.
How it works (simplified)
- You type
example.comin your browser - Your computer asks a DNS resolver: βWhatβs the IP for example.com?β
- The resolver checks its cache. If not cached, it asks the root servers β
.comservers βexample.comβs nameservers - The nameserver responds: βItβs
93.184.216.34β - Your browser connects to that IP address
- The result is cached so the next request is instant
This whole process takes milliseconds.
DNS record types
| Record | What it does | Example |
|---|---|---|
| A | Maps domain to IPv4 address | example.com β 93.184.216.34 |
| AAAA | Maps domain to IPv6 address | example.com β 2606:2800:220:1:... |
| CNAME | Alias to another domain | www.example.com β example.com |
| MX | Mail server | example.com β mail.example.com |
| TXT | Text data (verification, SPF, etc.) | v=spf1 include:_spf.google.com |
| NS | Nameserver for the domain | example.com β ns1.provider.com |
A records are the most common β they point your domain to a server IP.
CNAME records are aliases β www.example.com points to example.com, which has the actual A record.
Common DNS tasks
Point a domain to a server:
Type: A
Name: @ (or example.com)
Value: 93.184.216.34
TTL: 3600
Point www to the same place:
Type: CNAME
Name: www
Value: example.com
TTL: 3600
Verify domain ownership (Google, Vercel, etc.):
Type: TXT
Name: @
Value: google-site-verification=abc123...
DNS propagation
When you change DNS records, the change doesnβt happen instantly. Old records are cached by DNS servers worldwide.
- TTL (Time To Live) controls how long records are cached
- Low TTL (300 = 5 min): changes propagate fast, more DNS lookups
- High TTL (86400 = 24 hours): changes are slow, fewer lookups
Before making changes: lower the TTL to 300 a day in advance. After the change propagates, raise it back.
Checking propagation:
# Check from your machine
dig example.com
nslookup example.com
# Check from specific DNS server
dig @8.8.8.8 example.com
dig @1.1.1.1 example.com
Or use dnschecker.org to check from multiple locations worldwide.
Common DNS issues
βDNS not propagated yetβ β wait. It can take up to 48 hours (usually much less).
βSite not working after domain changeβ β check with dig:
dig example.com +short
# Should show your server's IP
βEmail not workingβ β check MX records:
dig example.com MX +short
βSSL certificate error after DNS changeβ β the new server needs its own SSL certificate. If using Letβs Encrypt, it needs DNS to be pointing to it first.
DNS providers
Your domain registrar usually provides DNS, but you can use a dedicated DNS provider for better performance:
- Cloudflare β free, fast, DDoS protection
- Route 53 β AWS, reliable, integrates with AWS services
- Google Cloud DNS β similar to Route 53
- Your registrar β Namecheap, GoDaddy, etc. (fine for simple setups)
For a more detailed technical walkthrough, see how DNS actually works. DNS is closely related to secure connections β learn more in what is HTTPS.
FAQ
How long does DNS propagation actually take?
It depends on the TTL (Time To Live) of the old record. If the TTL was 3600 (1 hour), most resolvers will pick up the change within an hour. In practice, most changes propagate within 1-4 hours, though it can take up to 48 hours for all global resolvers.
Can DNS go down and take my site offline?
Yes. If your DNS provider has an outage, browsers canβt resolve your domain to an IP address, making your site unreachable even if your server is fine. Using a provider with high uptime (Cloudflare, Route 53) and considering secondary DNS mitigates this risk.
Whatβs the difference between a domain registrar and a DNS provider?
A registrar is where you buy and own your domain name (Namecheap, Google Domains). A DNS provider hosts your DNS records and answers queries. They can be the same company, but you can use a different DNS provider (like Cloudflare) while keeping your registrar separate.
Related: How DNS Resolves a Domain Name Β· DNS Resolution Failed β fix Β· What is a CDN?