Public DNS servers: what they are and how to use one

What public DNS servers are, the main free resolvers and their addresses, how to switch and test one, and what they mean for your own website.

8–12 minutes
Close-up of light travelling through fibre optic strands

A public 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 → server is a free resolver that anyone can use instead of the one their internet provider hands out. This guide is for anyone who wants to know what these servers do, which addresses belong to the well-known ones, how to switch safely, and what changes (and what does not) for you and for your own website.

A public DNS server is a recursive resolver open to everyone, such as Cloudflare (1.1.1.1), Google (8.8.8.8) or Quad9 (9.9.9.9). To use one, replace the DNS server addresses in your device or router settings, always entering a primary and a secondary, then test with nslookup example.com 1.1.1.1. It changes who answers your lookups and what they can see, not your public IP addressIP 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 → or your download speed.

What a public DNS server actually does

Before your browser can open example.com, your device has to find the IP address of the server that hosts it. It sends that question to a recursive resolver: a server that chases the answer through the DNS system for you, starting at the root servers and ending at the domain’s own nameserver, then hands the answer back and remembers it for a while. How DNS works follows that journey step by step.

When you connect to a network, your router usually tells your device to use your internet provider’s resolver. A public DNS server is simply a different resolver, run by an organisation that opens it to the whole internet, free and without an account. You choose it by typing its address into your network settings.

It helps to be clear about what a public resolver is not:

  • It is not where your domain’s records live. Your records are held by your 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 → (often your registrar, your host or a DNS provider). A public resolver only asks those nameservers and passes on the answer.
  • It is not a VPN. Websites still see your own public IP address. Only the DNS question goes somewhere new.
  • It does not make your connection faster. It can make the first lookup of a name a few milliseconds quicker or slower, but it has no effect on download speed once a page starts loading.

The main free public DNS servers

These are the widely used free resolvers. Each publishes two IPv4 addresses so that one can take over if the other cannot be reached. The encrypted hostname is what you enter for DNS over HTTPS or Android’s Private DNS.

ServiceIPv4 addressesIPv6 addressesEncrypted DNS hostnameWhat sets it apart
Cloudflare1.1.1.1 and 1.0.0.12606:4700:4700::1111 and 2606:4700:4700::1001one.one.one.oneNo filtering, privacy focused, DNSSEC validation
Google Public DNS8.8.8.8 and 8.8.4.42001:4860:4860::8888 and 2001:4860:4860::8844dns.googleNo filtering, DNSSEC validation
Quad99.9.9.9 and 149.112.112.1122620:fe::fe and 2620:fe::9dns.quad9.netBlocks known malware and phishing domains, run by a non-profit
OpenDNS208.67.222.222 and 208.67.220.2202620:119:35::35 and 2620:119:53::53doh.opendns.comOptional content filtering with a free account
AdGuard DNS94.140.14.14 and 94.140.15.152a10:50c0::ad1:ff and 2a10:50c0::ad2:ffdns.adguard-dns.comBlocks ads and trackers by default

Some services also run filtered variants on separate addresses. Cloudflare, for example, offers 1.1.1.2 and 1.0.0.2 to block malware, and 1.1.1.3 and 1.0.0.3 to block malware and adult content. Quad9 offers 9.9.9.10 and 149.112.112.10 if you want its servers without threat blocking. Check the provider’s own documentation for the full list before you rely on a filtered address.

Server Brief has a guide each to Google DNS and Quad9 if you want the detail for one service.

Never mix resolvers from different services as primary and secondary if one of them filters. Your device may use either address at any time, so a blocked site will work one minute and fail the next. Pick one service and use both of its addresses.

Should you switch from your provider’s DNS?

There is no single right answer. These are the honest reasons people switch, and the reasons they do not.

Good reasons to switch:

  • Your provider’s resolver is unreliable. If pages sometimes fail with errors such as DNS_PROBE_FINISHED_NXDOMAIN and then work after a refresh, a public resolver is a quick test of whether DNS is the cause.
  • You want security filtering. Quad9, Cloudflare’s filtered addresses and OpenDNS block lookups for domains on threat lists.
  • You want encrypted lookups. Public resolvers support 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 → and DNS over TLS. Many provider resolvers do not.
  • You want to see changes sooner. After you move a website, a public resolver may pick up the new record sooner than a provider cacheCache 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 → that is still holding the old one. It is still bound by the record’s TTL, so it is not a shortcut around DNS propagation.

Reasons to stay:

  • Some networks need their own resolver. Office and school networks often have internal names (such as intranet.exampleco.local) that only the local resolver knows. A public resolver cannot find them.
  • Some providers route traffic by resolver location. Content delivery networks use the location of the resolver to pick a nearby server. Most large public resolvers handle this well, but occasionally a provider’s own resolver gives a closer result.
  • You are moving the trust, not removing it. A public resolver sees every name you look up instead of your provider. Read the service’s privacy policy and decide whom you trust more.

How to change your DNS server

Change it on your router if you want every device at home to use it. Change it on one device if you only want to test, or if you cannot get into the router. The examples use Cloudflare. Swap in the addresses of whichever service you chose.

Windows 10 and 11

  1. Open Settings, then Network & internet, then your connection (Wi-Fi or Ethernet).
  2. Next to DNS server assignment, select Edit, and change Automatic (DHCP) to Manual.
  3. Turn on IPv4 and enter 1.1.1.1 as preferred and 1.0.0.1 as alternate. Turn on IPv6 and add the IPv6 pair if your network uses IPv6.
  4. Select Save.

You can do the same in PowerShell run as administrator. Find the name of your adapter first, then set the servers:

Get-NetAdapter
Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ServerAddresses ("1.1.1.1","1.0.0.1")

macOS

  1. Open System Settings, then Network, and select your connection.
  2. Select Details, then DNS.
  3. Use the + button under DNS Servers to add 1.1.1.1 and 1.0.0.1. Remove any old entries with the – button.
  4. Select OK.

iPhone and Android

On an iPhone or iPad, go to Settings, Wi-Fi, tap the i next to your network, tap Configure DNS, choose Manual and add the addresses. This applies to that Wi-Fi network only.

On Android 9 and newer, the system-wide option is Private DNS under Settings, Network & internet. Choose Private DNS provider hostname and enter the encrypted hostname, such as one.one.one.one. This works on Wi-Fi and mobile data.

Your router

Sign in to your router’s admin page (often at an address printed on the router itself), look for DNS, WAN or Internet settings, and replace the automatic DNS servers with your chosen pair. Restart devices, or turn Wi-Fi off and on, so they pick up the new setting. Some provider routers lock this setting, in which case change it on each device instead.

Ubuntu Server with netplan

On Ubuntu 22.04 and 24.04 servers, set the resolvers in your netplan file, usually in /etc/netplan/. Under the network interface, add a nameservers block:

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

The use-dns: false line stops the addresses handed out by DHCP from being added alongside yours. Replace eth0 with your interface name from ip link. Then apply the change and check it:

sudo netplan try
resolvectl status

netplan try rolls back on its own after 120 seconds unless you confirm, which protects you from locking yourself out of a remote server. resolvectl status should list your new addresses under DNS Servers for that interface.

On a server, test the new resolvers before you apply them permanently. If the server cannot resolve names, package updates, outgoing email and SSL certificateSSL/TLS certificate The small file that proves a website is really who it says it is and turns on the padlock (HTTPS). More about SSL/TLS certificate → renewals all fail.

How to check which DNS server you are using

First, ask the resolver directly. This proves it answers from your network:

nslookup example.com 1.1.1.1

The reply starts with Server: and the address you asked, followed by the IP address of example.com. A timeout means something on your network is blocking 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 to outside resolvers. The DNS port guide explains how to test that.

Next, run nslookup example.com with no server named. The Server: line shows the resolver your device really uses. If it shows your router’s address (for example 192.168.1.1), that is normal: your router is forwarding to whatever it is set to upstream.

Finally, a DNS leak test shows which resolver your lookups reach in the end, which is the most reliable check when a router, VPN or browser setting might be in the way. Some services also have their own check page, such as Cloudflare’s 1.1.1.1/help and Quad9’s on.quad9.net.

If old answers persist after the switch, flush your DNS cache so your device asks the new resolver instead of reusing what it remembers.

Public DNS servers and your own website

If you run a website, public resolvers matter even if you never use one yourself, because a large share of your visitors do.

  • Use them to check a DNS change. After you edit a record, look it up against two or three public resolvers with dig @8.8.8.8 example.com A or nslookup example.com 9.9.9.9. If they disagree, some still hold the old answer until the TTLTTL How long other computers may remember a domain setting before checking again, in seconds. Short means changes show up faster. More about TTL → runs out. DNS lookup explains how to read the results.
  • Broken DNSSEC breaks your site for them. Cloudflare, Google and Quad9 all validate DNSSEC. If your domain’s DNSSEC is misconfigured, for example after a nameserver move that left an old DS record at the registrarDomain registrar The company you buy and renew your domain name from, and where you choose who handles its settings. More about Domain registrar →, these resolvers return an error and your site disappears for their users while it still works on resolvers that do not validate.
  • Filtering resolvers can block you. If a filtering service has listed your domain, for instance after a compromise, visitors who use it see a “site can’t be reached” error. Testing against an unfiltered address from the same service shows whether filtering is the cause.

Common problems

SymptomCauseFix
Some sites fail one minute and work the nextPrimary and secondary are from different services, one of which filtersUse both addresses from one service
Internal or work addresses stop resolvingPublic resolvers cannot see names that only exist on your local networkUse the network’s own resolver, or ask your IT team for split DNS
New setting seems ignoredBrowser DNS over HTTPS, a VPN or the router overrides the device settingCheck browser secure DNS settings and VPN DNS options, then run a DNS leak test
nslookup example.com 1.1.1.1 times outThe network blocks outgoing port 53 to anything but its own resolverUse encrypted DNS on port 443 or 853, or keep the network’s resolver
Your site works for you but not for some visitorsDNSSEC is broken, so validating resolvers reject the answerCheck the DS record at your registrar matches your current DNS provider
Old site still appears after a moveThe resolver is still caching the old record within its TTLWait for the TTL to expire, then flush your local cache

Official documentation

  • How DNS works: the full path of a lookup, from your device to the domain’s nameservers.
  • Google DNS: set-up and testing detail for 8.8.8.8 on every device.
  • Quad9 DNS: how threat blocking works and what it means for site owners.
  • DNS over HTTPS: encrypt your lookups to whichever public resolver you choose.

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.