ipconfig.co.uk

Change your DNS servers

DNS turns names into addresses. By default your devices ask your router, which asks your ISP. Switching to a different resolver can fix outages, speed up lookups, block malware or adult content, or give you encrypted queries. Here is how, everywhere.

Which servers?

ProviderIPv4IPv6Encrypted (DoH / DoT)Notes
Cloudflare1.1.1.1, 1.0.0.12606:4700:4700::1111, 2606:4700:4700::1001https://cloudflare-dns.com/dns-query · one.one.one.oneFast; 1.1.1.2 blocks malware, 1.1.1.3 blocks malware and adult content
Google8.8.8.8, 8.8.4.42001:4860:4860::8888, 2001:4860:4860::8844https://dns.google/dns-query · dns.googleVery widely used; no filtering
Quad99.9.9.9, 149.112.112.1122620:fe::fe, 2620:fe::9https://dns.quad9.net/dns-query · dns.quad9.netBlocks known malicious domains; Swiss non-profit
OpenDNS (Cisco)208.67.222.222, 208.67.220.2202620:119:35::35, 2620:119:53::53https://doh.opendns.com/dns-queryFamilyShield 208.67.222.123 / .220.123 blocks adult content
AdGuard94.140.14.14, 94.140.15.152a10:50c0::ad1:ff, 2a10:50c0::ad2:ffhttps://dns.adguard-dns.com/dns-query · dns.adguard-dns.comBlocks ads and trackers at DNS level
NextDNSper-accountper-accounthttps://dns.nextdns.io/Configurable filtering and logging per profile
Your router192.168.1.1 (typically)fe80::1 or the router's ULANoForwards to the ISP; needed for resolving local device names on many networks

Two things to weigh. First, local names: if you point a computer straight at 1.1.1.1, it can no longer resolve printer.home or nas via the router; use the router as one of the servers, or change DNS on the router instead of the device. Second, CDN locality: some content networks pick servers by your resolver's location; the large providers handle this well now, so it rarely matters.

Where to change it

  • On the router: every device on the LAN gets the new servers via DHCP. Best for households. The setting is usually under Internet/WAN or DHCP server; some ISP routers (Sky, Virgin Media Hub in router mode) do not allow it, in which case change it per device or put the hub in modem mode behind your own router.
  • On the device: overrides the router. Best for one machine, or laptops that roam.
  • In the browser: Chrome, Edge, Firefox and Brave can use DNS-over-HTTPS independently of the OS. Handy on a locked-down machine, but it only affects that browser.

Windows

Settings (Windows 11)

  1. Settings › Network & internet › Ethernet, or Wi-Fi › your network's properties.
  2. Next to DNS server assignment click Edit, choose Manual, switch IPv4 on.
  3. Enter preferred and alternate DNS. Set DNS over HTTPS to On (automatic template) for a provider Windows knows (Cloudflare, Google, Quad9) to encrypt the queries. Save.

Command line

Windows · Command Prompt
netsh interface ipv4 set dnsservers name="Ethernet" static 1.1.1.1 primary
netsh interface ipv4 add dnsservers name="Ethernet" 1.0.0.1 index=2
netsh interface ipv6 set dnsservers name="Ethernet" static 2606:4700:4700::1111 primary
ipconfig /flushdns

:: back to DHCP-supplied
netsh interface ipv4 set dnsservers name="Ethernet" source=dhcp
Windows · PowerShell
Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 1.1.1.1, 1.0.0.1
Clear-DnsClientCache
Get-DnsClientServerAddress -AddressFamily IPv4

# DNS over HTTPS (Windows 11)
Add-DnsClientDohServerAddress -ServerAddress 1.1.1.1 -DohTemplate https://cloudflare-dns.com/dns-query -AllowFallbackToUdp $false -AutoUpgrade $true
Get-DnsClientDohServerAddress

# back to DHCP-supplied
Set-DnsClientServerAddress -InterfaceAlias Ethernet -ResetServerAddresses

Apply it to every adapter at once: Get-NetAdapter | Where-Object Status -eq Up | Set-DnsClientServerAddress -ServerAddresses 1.1.1.1, 1.0.0.1.

macOS

  1. System Settings › Network › the service (Wi-Fi or Ethernet) › Details…DNS.
  2. Click + under DNS Servers and add each address. Greyed-out entries are the DHCP-supplied ones and disappear once you add your own.
  3. OK, then Apply. Flush: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
macOS · Terminal
sudo networksetup -setdnsservers "Wi-Fi" 1.1.1.1 1.0.0.1 2606:4700:4700::1111
networksetup -getdnsservers "Wi-Fi"
scutil --dns | grep nameserver          # what is really in use

# back to DHCP-supplied
sudo networksetup -setdnsservers "Wi-Fi" Empty

Encrypted DNS on macOS and iOS is set up by installing a configuration profile from the provider (Cloudflare, Quad9, NextDNS and AdGuard all publish one) or via an app such as the 1.1.1.1 app. Once installed it applies system-wide and shows in scutil --dns as a resolver with flags: Supplemental and a DoH/DoT protocol.

Linux

Linux · Terminal
sudo nmcli con mod "Wired connection 1" ipv4.dns "1.1.1.1 1.0.0.1" ipv4.ignore-auto-dns yes
sudo nmcli con mod "Wired connection 1" ipv6.dns "2606:4700:4700::1111" ipv6.ignore-auto-dns yes
sudo nmcli con up "Wired connection 1"
resolvectl status    # or: cat /etc/resolv.conf

ignore-auto-dns yes stops the DHCP-supplied servers being added alongside yours. To revert: ipv4.dns "" ipv4.ignore-auto-dns no.

If /etc/resolv.conf keeps reverting, something is managing it: systemd-resolved (the symlink to stub-resolv.conf), NetworkManager, resolvconf, or dhclient. Change the setting in that manager rather than fighting the file. Details →

iPhone and iPad

Settings › Wi-Fi › (i)Configure DNSManual › delete the existing entries and add yours. Per network; mobile data DNS cannot be changed in Settings. For all connections including mobile data, install a provider's encrypted-DNS profile (Settings › General › VPN & Device Management after downloading it) or use a DNS app.

Android

Two mechanisms. Private DNS (Android 9 and later): Settings › Network & internet › Private DNS › Private DNS provider hostname › enter one.one.one.one, dns.google, dns.quad9.net or dns.adguard-dns.com. This is DNS-over-TLS and applies to Wi-Fi and mobile data. Per-network static DNS: edit the Wi-Fi network › Advanced › IP settings › Static, which also requires a static IP; avoid unless you need it.

Routers

Look for Internet, WAN, DHCP Server or DNS settings. Two different fields may exist: the DNS servers the router itself uses upstream, and the DNS servers it hands to clients via DHCP. Changing the upstream one is enough for most homes (clients still point at the router, which forwards to your chosen resolver). Changing the DHCP one makes clients bypass the router. UK ISP hubs: BT Smart Hub 2 and later allow custom DNS under Advanced Settings › Broadband; Sky and Virgin Media hubs do not, and Virgin's Hub 5 in modem mode behind your own router is the usual workaround. OpenWrt: Network › Interfaces › WAN › Advanced › Use custom DNS servers; Pi-hole: Settings › DNS › Upstream servers.

Browsers (DNS-over-HTTPS)

BrowserWhere
Chrome, Edge, Brave, OperaSettings › Privacy and security › Security › Use secure DNS › choose a provider or enter a custom template
FirefoxSettings › Privacy & Security › DNS over HTTPS › Max Protection and a provider
SafariNo browser setting; uses the system resolver and profiles

Browser DoH bypasses the OS and the router entirely, including Pi-hole style blocking. If you run a network-wide blocker and it seems to have stopped working in one browser, this is why.

Verify which resolver is answering

Any shell
nslookup example.com                 # first lines show the server used (Windows/mac/Linux)
dig example.com | grep SERVER        # Linux/macOS
resolvectl status                    # Linux systemd-resolved
scutil --dns | grep nameserver       # macOS
Get-DnsClientServerAddress           # PowerShell
dig +short whoami.akamai.net         # returns the address of the resolver that reached Akamai
dig +short txt ch id.server @9.9.9.9 # which Quad9 node you hit

Then flush the cache (how) and, if using an encrypted provider, confirm at the provider's test page: Cloudflare has 1.1.1.1/help, which reports whether DoH or DoT is active.

Related pages

Last reviewed . Command syntax verified against Windows 11, Ubuntu 24.04, macOS 15 and FreeBSD 14 unless noted otherwise.

Spotted a mistake or a switch we have missed? Every page on this site is written to be checked against real output, so please test on your own machine and compare.