On this page
Before you change it
- What it does. Another server answers “what address has this name”. It can be faster, filter ads or malware, or know names your provider's server doesn't. It doesn't change your IP address and doesn't encrypt anything by itself.
- Take both addresses of one service. The second is a spare of the same kind. Mixing a filtering and an ordinary DNS gives a filter that works every other time.
- One device or the whole home. A device keeps its setting on every network. A router gives it to everyone at home and nowhere else.
- Write down what was there. Usually it is “automatic”, and the way back is to choose automatic again.
- Leave the VPN adapter alone. While a VPN is on, its own DNS answers: change it in the VPN client.
Windows 11 and Windows 10: in the settings
- 1
Open the connection
Windows 11: Settings → Network & internet → Wi-Fi → Hardware properties, or Ethernet. A DNS set for the whole Wi-Fi adapter overrides one set for a single known network.
- 2
Switch DNS to manual
DNS server assignment (DNS settings in some builds) → Edit → Manual. Turn on IPv4 and type the Preferred DNS and the Alternate DNS, for example
1.1.1.1and1.0.0.1. Then the same for IPv6. - 3
Choose DNS over HTTPS
Off is ordinary DNS. On (automatic template) works for servers Windows knows: Cloudflare, Google and Quad9 are on its list. On (manual template) takes an address such as
https://dns.adguard-dns.com/dns-query. Fallback to plaintext lets questions go unencrypted when HTTPS fails. - 4
Windows 10
Settings → Network & Internet → Change adapter options → right-click the connection → Properties → Internet Protocol Version 4 → Properties → Use the following DNS server addresses. The same in Version 6. Windows 10 has no DNS over HTTPS setting.
Windows: PowerShell
PowerShell as administrator. Put your adapter's name from the first answer in place of Wi-Fi.
Get-NetAdapter
Get-DnsClientServerAddressSet-DnsClientServerAddress -InterfaceAlias 'Wi-Fi' -ServerAddresses '1.1.1.1','1.0.0.1','2606:4700:4700::1111','2606:4700:4700::1001'
Clear-DnsClientCacheAdd-DnsClientDohServerAddress -ServerAddress '94.140.14.14' -DohTemplate 'https://dns.adguard-dns.com/dns-query' -AllowFallbackToUdp $False -AutoUpgrade $True
Get-DnsClientDohServerAddressWith AutoUpgrade on, every adapter that uses this address speaks HTTPS to it. The second line shows the list Windows knows.
Set-DnsClientServerAddress -InterfaceAlias 'Wi-Fi' -ResetServerAddressesBack to what the router gives.
macOS
System Settings → Network → Wi-Fi or Ethernet → Details → DNS: the plus under DNS Servers adds an address. The same in Terminal:
networksetup -listallnetworkservices
sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 2606:4700:4700::1111
scutil --dns | grep nameserverAddresses typed here are ordinary DNS. An encrypted one comes with an app or a configuration profile of the service.
sudo networksetup -setdnsservers Wi-Fi EmptyEmpty returns DNS to automatic.
Linux
Where the network is run by NetworkManager (Ubuntu, Fedora, Mint, most desktops), set DNS in the connection. Where systemd-resolved answers, one file sets it for the whole system, with encryption.
nmcli connection show
nmcli connection modify 'NAME' ipv4.dns '1.1.1.1 1.0.0.1' ipv4.ignore-auto-dns yes ipv6.dns '2606:4700:4700::1111' ipv6.ignore-auto-dns yes
nmcli connection up 'NAME'Undo: the same with empty quotes after dns and no after ignore-auto-dns.
sudo mkdir -p /etc/systemd/resolved.conf.d
printf '[Resolve]\nDNS=1.1.1.1#one.one.one.one 1.0.0.1#one.one.one.one\nDNSOverTLS=yes\nDomains=~.\n' | sudo tee /etc/systemd/resolved.conf.d/dns.conf
sudo systemctl restart systemd-resolved
resolvectl statusThe name after # is checked in the certificate, ~. sends every name here. Undo: delete the file and restart the service.
Android and iPhone
- Android, all networks at once: Settings → Network & internet → Private DNS → Private DNS provider hostname, for example
dns.googleordns.quad9.net. It takes a name, not an address, and is always encrypted. To undo, choose Automatic. If the item isn't there, search the settings for “Private DNS”. - iPhone and iPad, one Wi-Fi network: Settings → Wi-Fi → the (i) next to the network → Configure DNS → Manual → Add Server, remove the old ones, Save. Repeat for each network. It doesn't work for mobile data.
- iPhone, everywhere: an app or a configuration profile of the DNS service (since iOS 14) sets an encrypted DNS for Wi-Fi and mobile data. Take a profile only from the service's own site.
Router: the whole home
Open the router's page (often 192.168.0.1 or 192.168.1.1) and look in two places. In Internet or WAN, DNS is whom the router itself asks: devices go on asking the router. In LAN or DHCP, DNS is what devices get: they ask that server directly. One is enough; after a change in DHCP reconnect the devices. If the router hands out IPv6, its DNS is on a page of its own. Some providers lock these fields or answer port 53 themselves, and then only encrypted DNS on the device helps.
Check it, and what can go wrong
nslookup example.com prints the server that answered first. The DNS leak test on this site shows who really asks for you: if you see the new service there, the change works.
The test still shows the provider
CauseIPv6 DNS is the old one, or the router asks the provider
What to doSet IPv6 too; on a router look at both places
The test shows a third service
CauseThe browser has its own secure DNS
What to doTurn it off, or set the same service there
A hotel's or café's sign-in page doesn't open
CauseThat page exists only in the network's own DNS
What to doReturn to automatic, sign in, set it again
The printer, NAS or a work site is gone by name
CauseThose names are known only to the router or the office
What to doAutomatic DNS there, or their addresses
With the VPN on, nothing has changed
CauseThe VPN's own DNS answers
What to doChange it in the VPN client
Nothing opens at all
CauseA typo, or the network doesn't let that server through
What to doAutomatic, then another service