Network security

Google DNS Servers: 8.8.8.8 and 8.8.4.4 Explained and Set Up

Google Public DNS runs at 8.8.8.8 and 8.8.4.4. Here is what it does, how to switch to it on any device, and what Google logs.

Cysoro Security TeamPublished · 8 min read
NETWORK SECURITYGoogle DNS8.8.8.8The free resolver, its addresses, setup and privacy.IPv4 primary8.8.8.8IPv4 secondary8.8.4.4Encrypted DNSdns.googleIPv6: 2001:4860:4860::8888 • DoH: dns.google/dns-query
Quick answer

Google DNS servers are the addresses of Google Public DNS, a free recursive resolver: 8.8.8.8 and 8.8.4.4 for IPv4, and 2001:4860:4860::8888 and 2001:4860:4860::8844 for IPv6. You can also use encrypted DNS over HTTPS at dns.google/dns-query or DNS over TLS with the hostname dns.google. It validates DNSSEC, does not block domains, and keeps logs with your IP address for 24 to 48 hours.

Key takeaways

  • Google Public DNS IPv4 addresses are 8.8.8.8 (primary) and 8.8.4.4 (secondary); IPv6 uses 2001:4860:4860::8888 and ::8844.
  • It is a resolver only — it translates names to addresses, validates DNSSEC, and does not filter or block websites.
  • Encrypted DoH and DoT hide lookups from your network, but Google still sees them; logs with your IP are deleted within 24 to 48 hours.

Type 8.8.8.8 into a network settings box and you are using Google Public DNS, the free resolver Google has run since December 2009. It is one of the most typed addresses on the internet — and one of the least understood. Here is what it actually does, how to set it up, and what it costs you in privacy.

What are Google DNS servers?

Google DNS servers are the IP addresses of Google Public DNS, a free recursive DNS resolver run by Google. The IPv4 addresses are 8.8.8.8 (primary) and 8.8.4.4 (secondary), and the IPv6 addresses are 2001:4860:4860::8888 and 2001:4860:4860::8844.

A DNS resolver translates the names you type, such as example.com, into the IP addresses your device needs to connect. Your internet provider normally runs your resolver. Switching to Google's means your lookups go to Google's servers, as its setup guide describes, instead of your provider's. Google routes each query by anycast to the nearest of its servers, which is why the same address works everywhere in the world.

Google Public DNS is a resolver only. It is not the same as Google Cloud DNS, the paid service that hosts DNS records for domain owners. It also does not host websites or provide a VPN. It answers lookups, validates the answers, and sends them back.

What are all the Google DNS server addresses?

Google publishes four main addresses, plus encrypted endpoints and a DNS64 service for IPv6-only networks. Use the primary and secondary together so your device has a fallback if one does not answer.

ServicePrimarySecondary
IPv48.8.8.88.8.4.4
IPv62001:4860:4860::88882001:4860:4860::8844
IPv6, expanded form2001:4860:4860:0:0:0:0:88882001:4860:4860:0:0:0:0:8844
DNS64 (IPv6-only networks)2001:4860:4860::64642001:4860:4860::64
DNS over TLS (DoT)dns.google, port 853
DNS over HTTPS (DoH)https://dns.google/dns-query

Some devices cannot accept the abbreviated IPv6 form with ::, so Google also publishes the expanded form with all eight groups written out. DNS64 is only for IPv6-only networks with a NAT64 gateway using the 64:ff9b::/96 prefix; do not use it on a normal network. You can test the resolver in a browser at dns.google, which also offers a JSON API at dns.google/resolve.

What happens when you type a website name1Your deviceasks for the address2Google Public DNS8.8.8.8 finds it3Checks DNSSECis the answer real?4You connectto the real serverWithout encryption, anyone on your network can read step 1.With DoH or DoT, only Google sees the lookup — your ISP does not.Google still logs it for 24–48 hours. See the privacy section below.
A DNS lookup through Google Public DNS, with and without encryption. Illustration by Cysoro.

How does Google Public DNS work?

When your device asks Google Public DNS for a name, the resolver checks its cache, then asks the authoritative name servers for that domain, starting from the DNS root, until it gets an answer. It validates the answer with DNSSEC where the domain is signed, then returns the address to your device.

Google describes its service as a validating, security-aware resolver. DNSSEC validation means it checks the cryptographic signatures on DNS records, so a forged answer from an attacker should be rejected rather than passed on to you. That protects against cache poisoning, where an attacker tries to redirect you to a fake site.

Anycast routing is what makes one address work worldwide. Many servers advertise 8.8.8.8, and internet routing sends your query to the nearest one. Google also uses a large shared cache, so popular names are usually answered from memory in milliseconds rather than by a fresh lookup.

How do I set up Google DNS on Windows and Mac?

On Windows 11, go to Settings, then Network and internet, then your connection, then DNS server assignment, and switch it to Manual. Enter 8.8.8.8 as the preferred DNS server and 8.8.4.4 as the alternate, then repeat under IPv6 with the two IPv6 addresses.

Windows also supports encrypted DNS. In the same settings, set the DNS over HTTPS option to On for each server you add; Windows recognizes 8.8.8.8 and fills in the template automatically. On older Windows versions, the path is Control Panel, then Network and Sharing Center, then your adapter, then Properties, then Internet Protocol Version 4, then Properties, then Use the following DNS server addresses.

On a Mac, go to System Settings, then Network, then your connection, then Details, then DNS, and add 8.8.8.8 and 8.8.4.4 with the plus button, removing your old servers if you want Google to be the only resolver. On Linux, add nameserver 8.8.8.8 and nameserver 8.8.4.4 to /etc/resolv.conf, or set DNS=8.8.8.8 8.8.4.4 in systemd-resolved configuration, depending on your distribution.

After changing settings, flush the local cache so old answers do not linger. On Windows run ipconfig /flushdns in a command prompt. On a Mac run sudo dscacheutil -flushcache, followed by sudo killall -HUP mDNSResponder. Then test with our free DNS lookup tool to confirm the resolver answers correctly.

How do I set up Google DNS on Android, iPhone and a router?

On Android, the simplest encrypted setup is Private DNS: go to Settings, then Network and internet, then Private DNS, choose Private DNS provider hostname, and enter dns.google. Android then uses DNS over TLS, and on newer versions upgrades to DNS over HTTPS automatically.

For plain DNS on a single Wi-Fi network on Android, long-press the network, choose Modify network, then Advanced options, change IP settings to Static, and enter 8.8.8.8 and 8.8.4.4. That only affects that one network, while Private DNS applies everywhere, including mobile data.

On an iPhone or iPad, plain DNS can be set per Wi-Fi network under Settings, then Wi-Fi, then the network, then Configure DNS, then Manual. For encrypted DNS on iOS, install a configuration profile that sets dns.google for DoT or the DoH URL; iOS has no built-in text field for a DoT hostname in the main settings.

Setting Google DNS on your router covers every device on your home network at once, including smart TVs and game consoles. Log in to the router admin page, find the DNS or internet settings, and replace the provider addresses with 8.8.8.8 and 8.8.4.4.

Save, restart the router, and check that devices pick up the new settings. If you only want to protect your own traffic, device settings are enough; our guide to how to secure your Wi-Fi covers the router side in more depth.

What does Google DNS log about me?

Google keeps two kinds of logs. Temporary logs store your IP address with your queries and are deleted within 24 to 48 hours, except where Google keeps specific data longer to deal with a security or abuse issue. Google's Public DNS privacy page sets out both log types in detail. Permanent logs keep a sample of queries with your IP address removed and replaced by a city- or region-level location.

The permanent logs contain the domain requested, the record type, the request size, the transport protocol and the response code, but no personal information, according to Google's privacy page. Google says it does not use Public DNS personal data for ad targeting, and does not combine the logs with personal information from your Google account except to deal with security and abuse.

Two details matter for privacy. First, Google sends EDNS Client Subnet data to authoritative servers that support it, passing the first 24 bits of your IPv4 address so content networks can route you to a nearby server. Second, encrypted DNS hides your lookups from your network and ISP, but it does not hide them from Google — the resolver still sees every name you look up.

Google DNS vs Cloudflare, Quad9 and your ISP: which should I use?

Google is the best choice when you want a fast, reliable, unfiltered resolver from a provider that will still exist in ten years. Cloudflare 1.1.1.1 is the better choice if you want the shortest log retention, Quad9 9.9.9.9 is better if you want malware blocking, and your ISP resolver is the simplest choice if you do not want to change anything.

ResolverIPv4FilteringDNSSECLog retention
Google Public DNS8.8.8.8, 8.8.4.4NoneYesIP logs deleted in 24–48 hours
Cloudflare1.1.1.1, 1.0.0.1None on 1.1.1.1; malware and adult filters on 1.1.1.2 and 1.1.1.3YesIP never written to disk; other logs within 25 hours
Quad99.9.9.9, 149.112.112.112Blocks known malicious domainsYesNo IP logging on the main service
Your ISPAssigned by DHCPVariesVariesRead your ISP privacy policy

Speed varies by location, so do not take anyone's benchmark as gospel. Test with a DNS benchmark tool from your own network, and check which resolver answers fastest for the sites you actually visit. Reliability also matters: Google and Cloudflare both run anycast networks with very high uptime, while a small ISP resolver can be slower or go down during an outage.

Filtering is the biggest functional difference. Google does not block malicious domains, so a phishing link still resolves. Quad9 blocks domains on threat lists, and Cloudflare's 1.1.1.2 blocks malware. If you want filtering, pair Google DNS with browser and endpoint protection instead, or pick a filtering resolver.

Why is Google DNS not working?

The most common causes are a typo in the address, a network that blocks third-party DNS, a VPN or security app overriding your settings, or a stale cache. Check the address first: it is 8.8.8.8, not 8.8.8.0 or 8888, and the secondary is 8.8.4.4.

Some networks, especially school, work and public Wi-Fi, force all DNS through their own resolver and block port 53 to other servers. On those networks, plain Google DNS will fail, but encrypted DNS over HTTPS may still work because it looks like normal web traffic. A VPN can also override your DNS choice; check the VPN settings if lookups ignore your change.

If some sites load and others do not, flush the DNS cache and restart the browser, which keeps its own cache. If nothing loads after the change, revert to automatic DNS and confirm your internet works, then re-enter the addresses carefully. Use what is my IP and a DNS lookup to confirm what your device is actually using.

Picking a resolver: what actually differsGoogleFast, reliable,no filteringLogs: 24–48 hrsDoH + DoT: yesBest for: reliabilityCloudflareFast, short logs,optional filteringLogs: under 25 hrsDoH + DoT: yesBest for: privacyQuad9Blocks maliciousdomains by defaultLogs: no IP loggingDoH + DoT: yesBest for: blockingYour ISPNo setup needed,quality variesLogs: check policyDoH + DoT: variesBest for: simplicity
All four resolvers encrypt; they differ on filtering and logging. Illustration by Cysoro.

The bottom line

Google DNS servers 8.8.8.8 and 8.8.4.4 are a free, fast and reliable way to replace a slow or unreliable ISP resolver, with DNSSEC validation and encrypted DoH and DoT options. They do not filter websites, and Google logs your lookups with your IP address for 24 to 48 hours.

If that trade-off suits you, set both IPv4 addresses, add the IPv6 pair if your network supports it, and turn on encrypted DNS where your device allows it.

Then verify the change with the free DNS lookup tool.

Check your domain's own DNS health with our DNS and domain security tools.

Frequently asked questions

What are the Google DNS servers?

The Google DNS servers are 8.8.8.8 and 8.8.4.4 for IPv4, and 2001:4860:4860::8888 and 2001:4860:4860::8844 for IPv6. They belong to Google Public DNS, a free recursive DNS resolver that has run since December 2009.

Is 8.8.8.8 safe to use?

Yes, 8.8.8.8 is Google's official public resolver and it validates DNSSEC to protect against forged answers. It does not filter malware or adult content, and Google logs queries with your IP address for 24 to 48 hours, so it is not a privacy-first resolver.

What is the difference between 8.8.8.8 and 8.8.4.4?

There is no functional difference. 8.8.8.8 is the primary address and 8.8.4.4 is the secondary address. Set both so your device can fall back to the second one if the first does not answer.

Does Google DNS block websites?

No. Google Public DNS does not filter or block domains, except for certain domains in rare cases. If you want malware or adult-content filtering, use a filtering resolver instead.

How do I change my DNS to Google DNS?

Enter 8.8.8.8 as the preferred DNS server and 8.8.4.4 as the alternate in your device or router network settings. On Android, you can also set Private DNS to dns.google for encrypted DNS.

Is Google DNS faster than my ISP DNS?

Often, but not always. Google uses anycast routing to send your query to the nearest server, and its large cache answers popular names quickly. Speed depends on your location and network, so test your ISP resolver against Google before switching permanently.

What is dns.google?

dns.google is the hostname for Google Public DNS encrypted endpoints. Use it as the hostname for DNS over TLS on Android Private DNS and routers, and use the dns.google dns-query address for DNS over HTTPS.

Sources

  1. Google for Developers — Get Started | Public DNS
  2. Google for Developers — Public DNS
  3. Google for Developers — Your Privacy | Public DNS
  4. Google for Developers — Frequently Asked Questions | Public DNS
  5. Wikipedia — Google Public DNS
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Google's Public DNS setup, privacy and FAQ pages on Google for Developers.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free