How to Change DNS Server Using Command Prompt?

DNS also Known as Domain Name System is used to resolve human-readable hostnames like www.Technoresult.com  into machine-readable IP addresses like 103.50.160.145. DNS also provides other information about domain names, such as mail services. At first, a DNS server is sort of middleman between you and the website that you are trying to reach. It is the server that finds, for example, where the Gmail is by associating Gmail.com with an IP address. Usually, when you get an internet connection from a company like Airtel or use 4G or 3G from a company like Jio, they automatically provide you with a DNS server.

Depending on how fast is a DNS server, your internet connection will also feel fast or slow. Most of the users just leave the DNS server settings to default which is Provided by your Local ISP. But if you are facing any slowness or Problem for visiting any website, just think you always have an option to switch your DNS server. Some DNS server provides the fastest internet connection like Cloudflare.

In Windows 10 changing the DNS server is really simple, In three ways you can switch the DNS server address like from the settings app, from Network adapter Properties, and by using PowerShell, But this article will guide you to Change DNS Server Using Command Prompt.

Change DNS Server Using Command Prompt:

Open Command Prompt in elevated mode, Search for cmd from the start, and right-click on it and choose Run as administrator.

To change the DNS server using command Prompt, first, we need the Interface Name.

Type the below-mentioned command to get the Interface Name of the network adapters.

netsh interface show interface

SHow Interface

This command will list out the Number of the network adapter and their Interface Name. Note down the Interface Name for which you need to change the DNS server address.

Now execute the following commands by replacing the Preferred-DNS and Alternate-DNS with your original Preferred and alternate DNS address.

Change Preferred IPv4 DNS Address:

Netsh interface ipv4 set dnsservers "Interface Name" static “Preferred-DNS” primary

Change Alternate IPv4 DNS Address:

netsh interface ipv4 add dnsservers "Interface Name" “Alternate-DNS” index=2

Change DNS Server Using Command Prompt

Change Preferred IPv6 DNS Address:

Netsh interface ipv6 set dnsservers "Interface Name" static “Preferred-DNS” primary

Change Alternate IPv6 DNS Address:

netsh interface ipv6 add dnsservers "Interface Name" “Alternate-DNS” index=2

Note: Replace the Interface Name and Preferred and Alternate DNS address with the Original Parameters. See the image above if you have any doubt.

 

4 thoughts on “How to Change DNS Server Using Command Prompt?”

  1. Is there another way without Admin elevation. I need to allow my workers to change to our DNS servers based on their network work load throughout the week without my tech going to their offices everytime. They have a list of DNS and any DNS outside of that list would be blocked.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top