To change your DNS server on Windows 11, open Settings > Network & internet, select Wi-Fi or Ethernet, open your connection's properties, and select Edit next to DNS server assignment, then switch it to Manual and enter the new addresses. In an administrator PowerShell, Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ServerAddresses 1.1.1.1,1.0.0.1 does the same thing in one line.
All methods below need administrator rights. Write down your current settings first (the next section shows how) so you can go back if something stops resolving.
Check which DNS server you use now
This is read-only and needs no special rights:
Get-DnsClientServerAddress -AddressFamily IPv4 | Select-Object InterfaceAlias, InterfaceIndex, ServerAddresses
Example output (trimmed; virtual and VPN adapters with empty lists removed):
InterfaceAlias InterfaceIndex ServerAddresses
-------------- -------------- ---------------
Ethernet 27 {8.8.8.8, 1.1.1.1}
Wi-Fi 30 {192.168.1.254}
Note the InterfaceAlias (the connection name) and InterfaceIndex of the adapter you actually use; you need one of them for the commands below. A private address such as 192.168.1.254 means the PC asks your router, which forwards queries to your provider's resolver. From Command Prompt, ipconfig /all shows the same thing on the DNS Servers line of each adapter.
How to change DNS server in Windows 11 Settings
- Open Settings > Network & internet.
- Select Wi-Fi or Ethernet, then open the properties of the network you're connected to. For Wi-Fi this is the network name (or Manage known networks and then the network).
- Find DNS server assignment and select Edit. Don't use the IP assignment row: setting that to Manual gives the PC a fixed IP address as well, which you usually don't want.
- Change the drop-down from Automatic (DHCP) to Manual.
- Turn on IPv4, then enter Preferred DNS and Alternate DNS. Repeat under IPv6 if your connection has IPv6; otherwise any IPv6 DNS servers your router hands out stay in the list.
- Optionally choose a DNS over HTTPS mode (see below), then select Save.
Microsoft's support page describes the DNS over HTTPS options in this dialog as Off, On (automatic template) and On (manual template), plus a Fallback to plaintext switch: when on, Windows falls back to unencrypted DNS if the encrypted connection fails; when off, the lookup is dropped instead. The page notes this encryption option isn't available in Windows 10.
Common public DNS servers
| Provider | IPv4 | IPv6 |
|---|---|---|
| Cloudflare | 1.1.1.1, 1.0.0.1 | 2606:4700:4700::1111, 2606:4700:4700::1001 |
| Google Public DNS | 8.8.8.8, 8.8.4.4 | 2001:4860:4860::8888, 2001:4860:4860::8844 |
| Quad9 | 9.9.9.9, 149.112.112.112 | 2620:fe::fe, 2620:fe::9 |
These are the three providers on Windows' built-in list of known encrypted-DNS servers, which is why the encryption drop-down becomes available when you enter them. You can print that list yourself with Get-DnsClientDohServerAddress; on a Windows 11 23H2 machine it shows each address with its template, such as https://cloudflare-dns.com/dns-query. Any resolver works for plain DNS. Choosing one is a privacy decision as much as a speed one, since the resolver sees every name you look up; read the provider's policy.
How to change DNS with PowerShell
Open PowerShell as administrator (right-click Start > Terminal (Admin)). Use the alias or index from the check above:
Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ServerAddresses 1.1.1.1,1.0.0.1
Using the index instead of the name avoids quoting problems with names such as Ethernet 2:
Set-DnsClientServerAddress -InterfaceIndex 30 -ServerAddresses ("1.1.1.1","1.0.0.1")
Microsoft's reference notes that this sets the servers statically and overrides whatever DHCP provides for that interface. Two useful extras: -Validate checks that the addresses answer as DNS servers before applying them, and -WhatIf shows what would change without changing it. The command prints nothing on success; run Get-DnsClientServerAddress again to see the result.
Switch back to automatic
Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ResetServerAddresses
-ResetServerAddresses returns the interface to the DNS servers handed out by DHCP, usually your router.
How to change DNS with netsh (Command Prompt)
From an elevated Command Prompt, netsh does the same job without PowerShell:
netsh interface ipv4 set dnsservers name="Wi-Fi" source=static address=1.1.1.1 validate=no
netsh interface ipv4 add dnsservers name="Wi-Fi" address=1.0.0.1 index=2 validate=no
The first line replaces the list with one static server; the second adds a second server in position 2. The built-in help (netsh interface ipv4 set dnsservers /?) explains that validate defaults to yes, which checks the server first and can make the command slow when you're offline. To go back to automatic:
netsh interface ipv4 set dnsservers name="Wi-Fi" source=dhcp
Use netsh interface ipv6 with the same syntax for IPv6 servers.
Confirm the change worked
First clear the cache so old answers don't hide the change (more on flushing DNS):
ipconfig /flushdns
nslookup example.com
nslookup prints which server answered before the result. Example output (trimmed) with Cloudflare set as the DNS server:
Server: one.one.one.one
Address: 1.1.1.1
Non-authoritative answer:
Name: example.com
Addresses: 2606:4700:10::6814:179a
104.20.23.154
If Server: still shows your router's address, the change went to a different adapter than the one you're using. Run the check from the top again and compare interface names. PowerShell's Resolve-DnsName example.com -Server 1.1.1.1 is the equivalent query and also lets you test a server before switching to it.
If websites stop loading after the change
- Typo in an address. One wrong digit and every lookup times out. Re-check, or reset to automatic and try again.
- Company or school network. Internal names (intranet sites, file servers) only resolve through the organisation's own DNS servers. Public resolvers return "Non-existent domain" for them. Switch back on that network.
- Captive portals. Hotel and airport Wi-Fi often needs its own DNS to show the login page. Use automatic DNS until you're signed in.
- Encrypted DNS with fallback off. If the network blocks the encrypted connection, lookups fail. Turn Fallback to plaintext on, or set DNS over HTTPS to Off.
- A VPN. Many VPN clients push their own DNS servers on the VPN adapter, which take priority while connected.
To understand what the resolver actually does with your query, see how DNS works. For what the encryption option protects and what it doesn't, see DNS over HTTPS explained.
Frequently asked questions
- Does changing DNS make the internet faster?
- It can make the first visit to a site start a little sooner if the new resolver answers faster than your provider's, but it does not change download speed or bandwidth. Once a name is cached, DNS is not involved again until the cached answer expires. Measure with Resolve-DnsName or nslookup against each server rather than assuming.
- Do I need administrator rights to change DNS?
- Yes. Changing the DNS servers is a system-wide network setting, so Set-DnsClientServerAddress and netsh must run in an elevated (administrator) PowerShell or Command Prompt. Viewing the current servers with Get-DnsClientServerAddress or ipconfig /all needs no special rights.
- Should I change DNS on my PC or on my router?
- Changing it on the router applies to every device that gets its settings from that router, including phones and TVs. Changing it on the PC only affects that PC, and overrides whatever the router hands out. If you only want one computer on a different resolver, change it on the PC.
- Why did my DNS change not take effect in the browser?
- Two common reasons. The browser may still be using cached answers, so run ipconfig /flushdns and restart the browser. Or the browser has its own secure DNS setting turned on, in which case it sends lookups to its configured DNS-over-HTTPS provider and ignores the Windows setting.