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?

ConcernISP DefaultPublic Resolver
SpeedVaries; often slowerGlobally distributed anycast networks
ReliabilitySingle point of failureRedundant, highly available infrastructure
PrivacyISP may log queriesCloudflare promises limited logging; Google logs for performance analysis
FeaturesBasicDNS-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

PropertyDetail
Primary1.1.1.1
Secondary1.0.0.1
IPv62606:4700:4700::1111
FocusSpeed and privacy
FeaturesDNS-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

PropertyDetail
Primary8.8.8.8
Secondary8.8.4.4
IPv62001:4860:4860::8888
FocusReliability and performance
FeaturesDNS-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.8

This 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

SymptomLikely CauseAction
Slow website loadingSlow ISP DNSSwitch to 1.1.1.1
Some sites don’t resolveISP DNS filter/blockSwitch to 8.8.8.8
DNS leaks in VPNISP resolver still usedOverride resolver in VPN settings
Stale records after DNS changeISP cache too longUse lower-TTL query or flush cache

Source