Public DNS Resolvers
Most home and office networks use the DNS resolver provided by their ISP (Internet Service Provider) or local router. However, public DNS resolvers operated by Cloudflare and Google are popular alternatives that offer speed, reliability, and sometimes better privacy.
Why Use a Public Resolver?
| Concern | ISP Default | Public Resolver |
|---|---|---|
| Speed | Varies; often slower | Globally distributed anycast networks |
| Reliability | Single point of failure | Redundant, highly available infrastructure |
| Privacy | ISP may log queries | Cloudflare promises limited logging; Google logs for performance analysis |
| Features | Basic | DNS-over-HTTPS (DoH), DNS-over-TLS (DoT), malware blocking |
“There are majorly two popular ones: Cloudflare which has 1.1.1.1 and Google which is 8.8.8.8.” — Day 30 CKA Video
Cloudflare DNS: 1.1.1.1
| Property | Detail |
|---|---|
| Primary | 1.1.1.1 |
| Secondary | 1.0.0.1 |
| IPv6 | 2606:4700:4700::1111 |
| Focus | Speed and privacy |
| Features | DNS-over-HTTPS, DNS-over-TLS, malware filtering (1.1.1.2) |
Cloudflare operates one of the fastest DNS networks globally, with edge locations close to most internet users. They commit to not logging identifiable query data and purging logs within 24 hours.
Google DNS: 8.8.8.8
| Property | Detail |
|---|---|
| Primary | 8.8.8.8 |
| Secondary | 8.8.4.4 |
| IPv6 | 2001:4860:4860::8888 |
| Focus | Reliability and performance |
| Features | DNS-over-HTTPS, DNS-over-TLS |
Google Public DNS is one of the oldest and most reliable public resolvers. It uses anycast routing to route users to the nearest Google edge node.
How to Use a Specific Resolver
Per-Query (Testing)
# Use Cloudflare
nslookup piyushgarg.dev 1.1.1.1
# Use Google
nslookup piyushgarg.dev 8.8.8.8This sends the DNS query directly to the specified resolver, bypassing your default configuration. Useful for:
- Checking if your ISP’s resolver is returning stale data
- Comparing response times
- Troubleshooting DNS propagation
“I can say, ‘Hey, can you please use this DNS server which is of Cloudflare?’ This will basically go to Cloudflare’s DNS on port 53 and ask for stuff.” — Day 30 CKA Video
System-Wide (Linux/macOS)
Edit /etc/resolv.conf:
nameserver 1.1.1.1
nameserver 8.8.8.8
Or configure via your router’s admin panel so all devices on the network use the public resolver.
When to Switch
| Symptom | Likely Cause | Action |
|---|---|---|
| Slow website loading | Slow ISP DNS | Switch to 1.1.1.1 |
| Some sites don’t resolve | ISP DNS filter/block | Switch to 8.8.8.8 |
| DNS leaks in VPN | ISP resolver still used | Override resolver in VPN settings |
| Stale records after DNS change | ISP cache too long | Use lower-TTL query or flush cache |