Change Windows 10 DNS settings using Command Prompt

Use Command Prompt to change the DNS settings on Windows 10.

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to launch the tool to change the networking settings and press Enter:netsh
  4. Type the following command to identify the names of the network adapters and press Enter:interface show interface
  5. Type the following command to set the primary DNS IP address and press Enter:interface ip set dns name="ADAPTER-NAME" source="static" address="X.X.X.X"In the command, remember to change ADAPTER-NAME with the name of your network adapter you identified on step No. 4, and change X.X.X.X with the IP address of the DNS server that you want to use.If you want to use Cloudflare, Google Public DNS, or Cisco OpenDNS, you can use these settings:
    • Cloudflare: 1.1.1.1 and 1.0.0.1
    • Google Public DNS: 8.8.8.8 and 8.8.4.4
    • OpenDNS: 208.67.222.222 and 208.67.220.220For example, this command sets the primary DNS addres to 1.1.1.1:interface ip set dns name="Ethernet1" source="static" address="1.1.1.1"

Type the following command to add an alternative DNS IP address and press Enter:

interface ip add dns name="ADAPTER-NAME" addr="X.X.X.X" index=2

In the command, remember to change ADAPTER-NAME with the name of your network adapter you queried on step No. 4, and change X.X.X.X with the secondary address that you want to use.

For example, this command sets the secondary DNS addres to 1.0.0.1:

interface ip add dns name="Ethernet1" addr="1.0.0.1" index=2

Quick tip: If you need to add even more DNS addresses, you can repeat the above steps, but increase the number of the index option by 1. For instance, interface ip add dns name="Ethernet1" addr="8.8.8.8" index=3

Once you complete the steps, Windows 10 will start using the new DNS server addresses to resolve domain names to numeric addresses that your device can understand.

FavoriteLoadingAdd to favorites
Spread the love

Author: Shahzad Khan

Software developer / Architect