How to Change IPv4 and IPv6 DNS Server Address in Windows
A DNS (Domain Name System) server is the service that makes it possible for you to open a web browser, type a domain name and load your favorite websites.
When you subscribe to an Internet connection with an Internet Service Provider (ISP) (ex: Cox, Comcast, AT&T, etc...) in your area, you will use their DNS server by default. If you like, you can use third-party DNS servers (ex: Cloudflare, OpenDNS or Google Public DNS) instead, which could offer a variety of features that your ISP may not.
Sometimes the DNS servers are slow responding to requests, or they just are not reliable. Changing your default settings can improve your internet browsing experience.
When you set DNS on your computer, you manually override the DNS servers provided by the DHCP server in your router.
When you manually set DNS servers on your router, you manually override DNS servers provided to the router by the DHCP server at your ISP.
Starting with Windows 10 build 19268, you can now test DNS over HTTPS (DoH) in Windows 10.
Starting with Windows 10 build 20185, you can now select Unencrypted only (default), Encrypted only (DNS over HTTPS), or Encrypted preferred, unencrypted allowed in the Preferred DNS encryption and Alternate DNS encryption drop menus in Settings.
See also: Windows Insiders gain new DNS over HTTPS controls | Microsoft Networking Blog
This tutorial will show you how to change the IPv4 and IPv6 DNS server address in Windows 7, Windows 8, and Windows 10.
You must be signed in as an administrator to change the DNS server address.
Contents
- Option One: To Change DNS Server Address on Router
- Option Two: To Change IPv4 and IPv6 DNS Server Address in Control Panel
- Option Three: To Change IPv4 and IPv6 DNS Server Address in PowerShell
- Option Four: To Change IPv4 and IPv6 DNS Server Address in Command Prompt
- Option Five: To Change IPv4 and IPv6 DNS Server Address in Settings
1 If you connect to the Internet via a router, then you may want to change the DNS address in your router settings instead so all devices that connect via the router will use this DNS address if the computer is set to Obtain DNS server address automatically.
You'll need to read the manual for how to change the DNS settings for your router's model number.
1 Open the Control Panel (icons view), and click/tap on the Network and Sharing Center icon.
2 Click/tap on the Connections link (ex: "vEthernet (New Virtual Switch)") for your current network connection. (see screenshot below)
3 Click/tap on the Properties button. (see screenshot below)
4 In the Networking tab, select (highlight) Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6) for which one you want to change, and click/tap on the Properties button. (see screenshot below)
5 Do step 6 (Obtain DNS automatically) or step 7 (Use custom DNS) below for what you want to do.
This is the default setting.
A) In the General tab, select (dot) Obtain DNS server address automatically, click/tap on OK, and go to step 8 below. (see screenshots below)
![]()
A) In the General tab, select (dot) Use the following DNS server addresses. (see screenshots below)
B) Enter the Preferred DNS server and Alternate DNS server addresses you want to use, click/tap on OK, and go to step 8 below.
Third-party DNS servers Preferred IPv4 DNS server address Alternate IPv4 DNS server address Preferred IPv6 DNS server Alternate IPv6 DNS server address Google Public DNS 8.8.8.8 8.8.4.4 2001:4860:4860:8888
OR
2001:4860:4860:0:0:0:0:88882001:4860:4860:8844
OR
2001:4860:4860:0:0:0:0:8844OpenDNS 208.67.222.222 208.67.220.220 2620:0:ccc::2 2620:0:ccd::2 1.1.1.1 by Cloudflare 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001 Cloudflare (block malware only) 1.1.1.2 1.0.0.2 2606:4700:4700::1112 2606:4700:4700::1002 Cloudflare (block malware and adult content) 1.1.1.3 1.0.0.3 2606:4700:4700::1113 2606:4700:4700::1003 Quad9 9.9.9.9 149.112.112.112 2620:fe::fe 2620:fe::9 CleanBrowsing (Family filter) 185.228.168.168 185.228.168.169 2a0d:2a00:1:: 2a0d:2a00:2:: CleanBrowsing (Adult filter) 185.228.168.10 185.228.168.11 2a0d:2a00:1::1 2a0d:2a00:2::1 ![]()
8 Click/tap on Close. (see screenshot below)
9 Click/tap on Close. (see screenshot below step 3)
10 You can now close the Network and Sharing Center if you like. (see screenshot below step 2)
11 If you like or needed, you can flush the DNS resolver cache to make sure the new DNS server is applied.
1 Open an elevated PowerShell.
2 Enter the command below into the elevated PowerShell, press Enter, and make note of the Interface Alias (ex: "Ethernet") you want to change the IPv4 or IPv6 DNS server address for. (see screenshot below)
Get-DnsClientServerAddress
You will also be able to see the current IPv4 and IPv6 DNS server addresses for network connections (InterfaceAlias).
3 Do step 4 (Obtain DNS automatically), step 5 (Change IPv4 DNS), or step 6 (Change IPv6 DNS) below for what you want to do.
This is the default setting.
A) Enter the command below you want to use into the elevated command prompt, press Enter, and go to step 7 below. (see screenshot below)
Set-DNSClientServerAddress "Interface Alias" -ResetServerAddresses
Substitute Interface Alias in the command above with the actual Interface Alias (ex: "Ethernet") from step 2 above.
A) Enter the command below you want to use into the elevated PowerShell, press Enter, and go to step 7 below. (see screenshot below)
Set-DNSClientServerAddress "Interface Alias" –ServerAddresses ("Preferred DNS address", "Alternate DNS address")
Substitute Interface Alias in the command above with the actual Interface Alias (ex: "Ethernet") from step 2 above.
Substitute Preferred DNS address in the command above with the actual preferred IPv4 DNS server address (see table below) you want to use for this network connection.
Substitute Alternate DNS address in the command above with the actual alternate IPv4 DNS server address (see table below) you want to use for this network connection.
For example:Set-DNSClientServerAddress "Ethernet" –ServerAddresses (“1.1.1.1”,”1.0.0.1”)
Third-party DNS servers Preferred IPv4 DNS server address Alternate IPv4 DNS server address Google Public DNS 8.8.8.8 8.8.4.4 OpenDNS 208.67.222.222 208.67.220.220 1.1.1.1 by Cloudflare 1.1.1.1 1.0.0.1 Cloudflare (block malware only) 1.1.1.2 1.0.0.2 Cloudflare (block malware and adult content) 1.1.1.3 1.0.0.3 Quad9 9.9.9.9 149.112.112.112 CleanBrowsing (Family filter) 185.228.168.168 185.228.168.169 CleanBrowsing (Adult filter) 185.228.168.10 185.228.168.11
A) Enter the command below you want to use into the elevated PowerShell, press Enter, and go to step 7 below. (see screenshot below)
Set-DNSClientServerAddress "Interface Alias" –ServerAddresses ("Preferred DNS address", "Alternate DNS address")
Substitute Interface Alias in the command above with the actual Interface Alias (ex: "Ethernet") from step 2 above.
Substitute Preferred DNS address in the command above with the actual preferred IPv6 DNS server address (see table below) you want to use for this network connection.
Substitute Alternate DNS address in the command above with the actual alternate IPv6 DNS server address (see table below) you want to use for this network connection.
For example:Set-DNSClientServerAddress "Ethernet" –ServerAddresses (“2606:4700:4700::1111”,”2606:4700:4700::1001”)
Third-party DNS servers Preferred IPv6 DNS server Alternate IPv6 DNS server address Google Public DNS 2001:4860:4860:0:0:0:0:8888 2001:4860:4860:0:0:0:0:8844 OpenDNS 2620:0:ccc::2 2620:0:ccd::2 1.1.1.1 by Cloudflare 2606:4700:4700::1111 2606:4700:4700::1001 Cloudflare (block malware only) 2606:4700:4700::1112 2606:4700:4700::1002 Cloudflare (block malware and adult content) 2606:4700:4700::1113 2606:4700:4700::1003 Quad9 2620:fe::fe 2620:fe::9 CleanBrowsing (Family filter) 2a0d:2a00:1:: 2a0d:2a00:2:: CleanBrowsing (Adult filter) 2a0d:2a00:1::1 2a0d:2a00:2::1
7 If you like or needed, you can flush the DNS resolver cache to make sure the new DNS server is applied.
8 You can now close the elevated PowerShell if you like.
1 Open an elevated command prompt.
2 Enter the command below into the elevated command prompt, press Enter, and make note of the Interface Name (ex: "Ethernet") you want to change the IPv4 or IPv6 DNS server address for. (see screenshot below)
netsh interface show interface
3 Do step 4 (Obtain DNS automatically) or step 5 (Use custom DNS) below for what you want to do.
This is the default setting.
A) Enter the command below you want to use into the elevated command prompt, press Enter, and go to step 6 below. (see screenshot below)
(IPv4 DNS)
netsh interface ipv4 set dnsservers "Connection Name" dhcp
OR
(IPv6 DNS)
netsh interface ipv6 set dnsservers "Connection Name" dhcp
Substitute Connection Name in the command above with the connection name (ex: "vEthernet (New Virtual Switch)") from step 2 above.
A) Enter the command below you want to use into the elevated command prompt, and press Enter. (see screenshot below)
(IPv4 DNS)
netsh interface ipv4 set dnsservers "Connection Name" static Preferred DNS address primary
OR
(IPv6 DNS)
netsh interface ipv6 set dnsservers "Connection Name" static Preferred DNS address primary
Substitute Connection Name in the command above with the connection name (ex: "Ethernet") from step 2 above.
Substitute Preferred DNS address in the command above with the actual preferred IPv4 or IPv6 DNS server address (see table below) you want to use for this network connection.
For example:netsh interface ipv6 set dnsservers "Ethernet" static 2001:4860:4860:0:0:0:0:8888 primary
Third-party DNS servers Preferred IPv4 DNS server address Preferred IPv6 DNS server address Google Public DNS 8.8.8.8 2001:4860:4860:0:0:0:0:8888 OpenDNS 208.67.222.222 2620:0:ccc::2 1.1.1.1 by Cloudflare 1.1.1.1 2606:4700:4700::1111 Cloudflare (block malware only) 1.1.1.2 2606:4700:4700::1112 Cloudflare (block malware and adult content) 1.1.1.3 2606:4700:4700::1113 Quad9 9.9.9.9 2620:fe::fe CleanBrowsing (Family filter) 185.228.168.168 2a0d:2a00:1:: CleanBrowsing (Adult filter) 185.228.168.10 2a0d:2a00:1::1
B) Enter the command below into the elevated command prompt, press Enter, and go to step 6 below. (see screenshot below)
(IPv4 DNS)
netsh interface ipv4 add dnsservers "Connection Name" Alternate DNS address index=2
OR
(IPv6 DNS)
netsh interface ipv6 add dnsservers "Connection Name" Alternate DNS address index=2
Substitute Connection Name in the command above with the connection name (ex: "Ethernet") from step 2 above.
Substitute Alternate DNS address in the command above with the actual alternate IPv4 or IPv6 DNS server address (see table below) you want to use for this network connection.
For example:netsh interface ipv6 add dnsservers "Ethernet" 2001:4860:4860:0:0:0:0:8844 index=2
Third-party DNS servers Alternate IPv4 DNS server address Alternate IPv6 DNS server address Google Public DNS 8.8.4.4 2001:4860:4860:0:0:0:0:8844 OpenDNS 208.67.220.220 2620:0:ccd::2 1.1.1.1 by Cloudflare 1.0.0.1 2606:4700:4700::1001 Cloudflare (block malware only) 1.0.0.2 2606:4700:4700::1002 Cloudflare (block malware and adult content) 1.0.0.3 2606:4700:4700::1003 Quad9 149.112.112.112 2620:fe::9 CleanBrowsing (Family filter) 185.228.168.169 2a0d:2a00:2:: CleanBrowsing (Adult filter) 185.228.168.11 2a0d:2a00:2::1
6 If you like or needed, you can flush the DNS resolver cache to make sure the new DNS server is applied.
After flushing it, one may run the
nslookup
command to check whether the new DNS server has been applied. For example, if Google Public DNS has been applied, the output will be:
Default Server: dns.google
Address: 8.8.8.8
7 You can now close the elevated command prompt if you like.
This option is only available starting with Windows 10 build 18252.
1 Open Settings, and click/tap on the Network & Internet icon.
2 Perform the action below you want to do depending on if you want to change the IPv4 and/or IPv6 DNS address for an Ethernet or Wi-Fi connection. (see screenshots below)
(Ethernet)
A) Click/tap on Ethernet on the left side, and click/tap on the connection (ex: "Brink-Router2") on the right side you want to edit the DNS address settings for.
OR
(Wi-Fi)
B) Click/tap on Wi-Fi on the left side, and click/tap on the connection (ex: "Brink-Router2") on the right side you want to edit the DNS address for.
![]()
3 Click/tap on the Edit button under IP settings. (see screenshot below)
4 Do step 5 (Obtain DNS automatically) or step 6 (Change DNS) below for what you want to do.
This is the default setting.
A) Select Automatic (DHCP) in the Edit IP settings drop menu, click/tap on Save, and go to step 7 below. (see screenshot below)
A) Select Manual in the Edit IP settings drop menu. (see screenshots below)
B) Turn on IPv4, and enter the Preferred DNS and Alternate DNS addresses you want to use.
If you turn off IPv4, its DNS address will be obtained automatically instead of using a custom DNS.
Starting with Windows 10 build 20185, you can now select Unencrypted only (default), Encrypted only (DNS over HTTPS), or Encrypted preferred, unencrypted allowed in the Preferred DNS encryption and Alternate DNS encryption drop menus. You can add any IP address listed here to unlock the DoH dropdown and choose to use encryption.
Third-party DNS servers Preferred IPv4 DNS server address Alternate IPv4 DNS server address Google Public DNS 8.8.8.8 8.8.4.4 OpenDNS 208.67.222.222 208.67.220.220 1.1.1.1 by Cloudflare 1.1.1.1 1.0.0.1 Cloudflare (block malware only) 1.1.1.2 1.0.0.2 Cloudflare (block malware and adult content) 1.1.1.3 1.0.0.3 Quad9 9.9.9.9 149.112.112.112 CleanBrowsing (Family filter) 185.228.168.168 185.228.168.169 CleanBrowsing (Adult filter) 185.228.168.10 185.228.168.11
C) Turn on IPv6, and enter the Preferred DNS and Alternate DNS addresses you want to use.
If you turn off IPv6, its DNS address will be obtained automatically instead of using a custom DNS.
Starting with Windows 10 build 20185, you can now select Unencrypted only (default), Encrypted only (DNS over HTTPS), or Encrypted preferred, unencrypted allowed in the Preferred DNS encryption and Alternate DNS encryption drop menus. You can add any IP address listed here to unlock the DoH dropdown and choose to use encryption.
Third-party DNS servers Preferred IPv6 DNS server Alternate IPv6 DNS server address Google Public DNS 2001:4860:4860:0:0:0:0:8888 2001:4860:4860:0:0:0:0:8844 OpenDNS 2620:0:ccc::2 2620:0:ccd::2 1.1.1.1 by Cloudflare 2606:4700:4700::1111 2606:4700:4700::1001 Cloudflare (block malware only) 2606:4700:4700::1112 2606:4700:4700::1002 Cloudflare (block malware and adult content) 2606:4700:4700::1113 2606:4700:4700::1003 Quad9 2620:fe::fe 2620:fe::fe:9 CleanBrowsing (Family filter) 2a0d:2a00:1:: 2a0d:2a00:2:: CleanBrowsing (Adult filter) 2a0d:2a00:1::1 2a0d:2a00:2::1
D) When finished, click/tap on Save, and go to step 7 below.
![]()
7 You can now close Settings if you like.
That's it,
Shawn Brink
Related Tutorials
- How to Flush DNS Resolver Cache in Windows 10
- How to Enable or Disable IPv6 in Windows 7, Windows 8, and Windows 10
- How to Find Private and Public IP Address of Your Windows 10 PC
- How to reset Hosts file back to default in Windows
- How to Enable or Disable DNS over HTTPS (DoH) in Google Chrome
- How to Enable or Disable DNS over HTTPS (DoH) in Firefox
- How to Enable or Disable DNS over HTTPS (DoH) in Microsoft Edge