Google DNS: what 8.8.8.8 is and how to use it

What Google Public DNS (8.8.8.8 and 8.8.4.4) does, whether to use it, and how to set and test it on Windows, Mac, phones, routers and Ubuntu.

7–11 minutes
Aerial view of a data center campus

Google DNSDNS The internet’s phone book. It turns a name people can remember, like example.com, into the number address computers use to find the server. More about DNS → (officially Google Public DNS) is a free DNS resolver that anyone can use by setting their device or router to 8.8.8.8 and 8.8.4.4. This guide is for anyone who has seen those numbers and wants to know what they do, whether to use them, and how to switch over on a computer, phone, router or Linux server.

Google DNS is a free public resolver that turns domain names into IP addressesIP address The number address of a device on the internet, like 203.0.113.10. Computers use it to find each other, the way post uses street addresses. More about IP address →. The addresses are 8.8.8.8 and 8.8.4.4 for IPv4, 2001:4860:4860::8888 and 2001:4860:4860::8844 for IPv6, and dns.google for encrypted DNS. To use it, replace the DNS servers in your network settings with those addresses, then test with nslookup example.com 8.8.8.8. It changes who answers your lookups, not your internet speed or your public IP address.

What Google DNS actually is

Every time you open a website, your device first has to find the server’s IP address. It asks a recursive resolver: a server whose job is to chase the answer through the DNS system on your behalf and hand it back. If you want the full journey, from root servers to the domain’s own nameserversNameserver The server that holds all of a domain’s settings. Whoever runs your nameservers controls where your website and email point. More about Nameserver →, read how DNS works.

Most people use whichever resolver their internet provider hands out automatically. Google Public DNS is an alternative resolver that Google runs and opens to everyone, free, with no account. When you set your device to 8.8.8.8, your lookups go to Google instead of your provider.

A few things it is not:

  • It is not a nameserver for your domain. Google DNS answers questions; it does not hold your records. Your domain’s records live on its nameserver, usually at your registrarDomain registrar The company you buy and renew your domain name from, and where you choose who handles its settings. More about Domain registrar →, host or DNS provider. Changing your computer to 8.8.8.8 has no effect on your website’s DNS.
  • It is not a VPN. Websites still see your normal public IP address. Only the DNS question goes to Google.
  • It is not a content filter. Google Public DNS does not offer a version that blocks malware or adult sites. If you want filtering, you need a resolver that advertises it.

The addresses

PurposeAddress
IPv4 primary8.8.8.8
IPv4 secondary8.8.4.4
IPv6 primary2001:4860:4860::8888
IPv6 secondary2001:4860:4860::8844
DNS over TLS (port 853)dns.google
DNS over HTTPS (port 443)https://dns.google/dns-query

Both addresses in each pair reach the same service. Google uses anycast, which means the same address is announced from many locations, and your query is routed to a nearby one. You enter two so your device has a fallback if one route is having trouble.

Should you use it?

There is no single right answer. Here is what actually changes when you switch.

QuestionYour provider’s resolverGoogle Public DNS
Who sees which sites you look upYour internet providerGoogle (your provider can still see traffic unless DNS is encrypted)
ReliabilityVaries by providerLarge, well run network
DNSSEC validationVaries by providerYes, it checks signed domains
Encrypted DNSOften not offeredDNS over TLS and DNS over HTTPS
Filtering or parental controlsSometimes, depending on providerNone
SetupAutomaticChange one setting per device or once on the router

Speed. A resolver mainly affects how fast the first lookup for a name is answered. Once an answer is cachedCache A saved copy of something, kept so it does not have to be made or fetched again. Like keeping a printed copy instead of reprinting it for every person who asks. More about Cache → on your device, the resolver is not asked again until the record’s TTL runs out. Switching may make the first visit to a site slightly quicker or slower depending on where you are, but it will not raise your download speed.

Privacy. According to Google’s privacy page for the service, it keeps temporary logs that include your IP address and deletes them within 24 to 48 hours, and keeps a sample of permanent logs with the IP address removed and replaced by a rough location. Google says this data is not linked to your Google account or used for advertising. Whether that suits you is your call: you are choosing between trusting your provider and trusting Google with your lookups.

Good reasons to switch: your provider’s resolver is unreliable or slow to pick up changes, it redirects mistyped names to a search page, you want encrypted DNS, or you are troubleshooting and want a known, neutral resolver to compare against.

How to set Google DNS on your device

Changing DNS on one device affects only that device. Changing it on the router affects everything on your network that takes its settings from the router.

Windows 10 and 11

  1. Press Windows + R, type ncpa.cpl and press Enter. This opens Network Connections.
  2. Right-click your active connection (Wi-Fi or Ethernet) and choose Properties.
  3. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  4. Choose Use the following DNS server addresses and enter 8.8.8.8 as preferred and 8.8.4.4 as alternate. Click OK.
  5. Repeat with Internet Protocol Version 6 (TCP/IPv6) using the IPv6 addresses, if your connection uses IPv6.

On Windows 11 you can also go to Settings, Network & internet, open your connection, and click Edit next to DNS server assignment. That screen also lets you turn on DNS over HTTPSHTTPS The secure version of the web, shown by the padlock. Everything sent between you and the site is scrambled so nobody in between can read or change it. More about HTTPS → for Google’s addresses.

To do the same in PowerShell (run as administrator), first find the connection’s name, then set the servers:

Get-NetAdapter
Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ServerAddresses ("8.8.8.8","8.8.4.4")

To go back to automatic DNS from your router:

Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ResetServerAddresses

macOS

Open System Settings, Network, choose Wi-Fi or Ethernet, click Details, then DNS. Click + and add 8.8.8.8 and 8.8.4.4. Remove any old entries you no longer want, then click OK.

From Terminal, the same change for Wi-Fi is:

networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4

To return to the router’s servers, replace the addresses with empty:

networksetup -setdnsservers Wi-Fi empty

iPhone and iPad

Go to Settings, Wi-Fi, tap the i next to your network, tap Configure DNS, choose Manual, delete the existing servers and add 8.8.8.8 and 8.8.4.4. This applies to that Wi-Fi network only, not mobile data.

Android

Android 9 and later has a Private DNS setting that encrypts lookups using DNS over TLS. Open Settings, Network & internet, Private DNS, choose Private DNS provider hostname and enter dns.google. The menu names vary between phone makers; search Settings for “Private DNS” if you cannot find it. This works on Wi-Fi and mobile data.

Your router

Log in to your router’s admin page (often printed on a label on the router), find the DHCP or internet settings, and replace the DNS servers with 8.8.8.8 and 8.8.4.4. Devices pick up the change when they next renew their connection, which you can force by turning Wi-Fi off and on. Some provider-supplied routers lock this setting, in which case set DNS on each device instead.

Ubuntu Server (netplan)

On Ubuntu servers the network is configured by netplan, in YAML files under /etc/netplan/. List them with ls /etc/netplan/ and edit the one for your network card. If the server gets its address by DHCP, tell it to ignore the DHCP-supplied DNS and use Google’s instead:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true
      dhcp4-overrides:
        use-dns: false
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]

Replace eth0 with your interface name from ip link. Then apply it safely:

sudo netplan try

netplan try applies the change and rolls it back automatically after 120 seconds unless you press Enter to confirm, so a typo cannot cut you off a remote server. Confirm the result with:

resolvectl status

Look for 8.8.8.8 under DNS Servers for your interface.

On cloud servers, the netplan file is often written by cloud-init and can be regenerated on reboot. Check the comments at the top of the file. If it says changes will not persist, follow the instructions there or set DNS in your provider’s network settings instead.

How to check it is working

Ask Google directly and see that you get an answer. On Windows, macOS or Linux:

nslookup example.com 8.8.8.8

The Server: line should show 8.8.8.8 and you should see an address for example.com. On Linux and macOS, dig gives more detail:

dig @8.8.8.8 example.com

A status: NOERROR line means the lookup succeeded. That proves Google is reachable, but not that your device is using it by default. To see which resolver really answers your normal lookups, run:

dig +short TXT o-o.myaddr.l.google.com

When your lookups go through Google, this returns an address belonging to Google’s network. If it returns your provider’s address, your setting has not taken effect yet. For a full walk through reading these answers, see how to check a domain’s DNS records.

After switching, it is worth clearing your computer’s old answers so everything is fetched fresh: how to flush your DNS cache.

Google DNS for website owners

Even if you never change your own settings, Google DNS is useful when you run a site.

  • Checking a change. After editing a record, dig @8.8.8.8 example.com shows what a large share of the internet’s visitors are being told, separate from your own cached answer.
  • Clearing Google’s cache. If you have just fixed a record and Google is still serving the old answer, Google offers a Flush Cache page for Google Public DNS. Enter the domain and record type to make Google fetch it again. When you have changed nameservers or registrar, flush the main domain before any subdomainsSubdomain A name in front of your domain, like shop.example.com or blog.example.com. It can show a different site from the main one. More about Subdomain →. This only clears Google’s copy; other resolvers still wait for the TTL.
  • Encrypted DNS tests. Google’s DNS over HTTPS service at https://dns.google is handy for checking answers from networks where portPort A numbered door on a server. Each service listens behind its own door: web pages on 443, email on others, remote login on 22. More about Port → 53, the normal DNS port, is blocked.

Common problems

SymptomCauseFix
Settings changed but the TXT test still shows your providerDNS set on the wrong connection, or the router forces its own DNSCheck the active connection, then set it on the router or per device
Nothing loads after switchingTypo in the address, or a network that blocks outside DNSRe-enter 8.8.8.8 exactly; on work or school networks, use their DNS
Company or intranet names stop workingInternal names exist only on your organisation’s DNS serversUse the DNS servers your organisation provides on that network
Android Private DNS says it cannot connectThe network blocks port 853Set Private DNS to Automatic on that network
Google shows a new record but your browser does notYour computer or browser cached the old answerFlush your local DNS cache and restart the browser
Server loses DNS after a rebootCloud-init rewrote the netplan fileMake the change in the place the file’s comments point to

Official documentation

Get the next guide

One email when there is something worth reading: new guides, errors going around, and hosting changes that affect your site.

No tracking pixels, and one click to leave.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.