How To Change IP Address And DNS Servers Using Command Prompt

You might have heard of IP (Internet Protocol) address and DNS server. If you have a way with computer world, you would be very well aware about the use of these terms. If you are a normal user of computer then you may have a shadowy idea of what an IP address and DNS actually is? In a simple language, IP address allows your device to communicate with other digital devices over the internet. It is just like an address of your device without which two-way communication is not possible.

DNS  Server, basically contains a database of network names and addresses for other Internet hosts. Whenever DNS server receives user input, it converts the input into IP address and search that from its pool. After that connect the server of that IP address to the user.

You can also change an IP address and DNS server of your computer whenever required. There are two methods to change the IP address of your computer. The first method is via control panel and another one is via command prompt.

To change the IP address and DNS server of your computer via Control Panel interface is not a difficult one but it is time consuming as you have to pass through number of windows and dialog boxes. Netsh command is the easiest way to meet your requirement of changing IP address and DNS server of your computer by using Command Prompt.

Netsh is a nifty utility to change networking settings of your computer running Microsoft Windows. You can change settings both locally and remotely.

How To Change IP Address, Subnet Mask And Default Gateway Of Your Computer Using Command Prompt

First of all, open Command Prompt with administrative privileges. For this, right click on the Start menu and select Command Prompt (Admin).


Type the command netsh interface ipv4 show config on the command prompt windows and hit Enter key. You will see the configuration of list of networks.

change ip address command-prompt

Also read: How To Generate Battery Report In Windows 10 OS


Scroll down the screen and find the interface in which you want to make changes. Note the exact name of the interface for the reference. You can also copy & paste the interface name to any of the word processing program like notepad or wordpad and use it on command prompt.
For example, here we are going to change the Wi-Fi interface so we have noted the name of this particular interface to make changes.

change ip address and dns servers

Run the command using following syntax:

change ip address and dns servers


change ip address and dns servers

You can copy the following given syntax example.

netsh interface ipv4 set address name=”Wi-Fi” static

In this example we have changed the following information of interface name “Wi-Fi” by using this netsh command.

IP address to

Subnet mask

Default Gateway to

Also read: How To Capture Screenshot In Google Chrome (Including Device Frame)

How To Change DNS server Of Your Computer Using Command Prompt

It is not always compulsory to use the DNS servers provided by your ISP (Internet Service Provider). It is strongly recommended to use Google Public and Open DNS which are more reliable and fast. You can change the DNS server by using netsh command.

You have to run netsh command twice just to set primary as well as secondary DNS server. Run the command as per following syntax:




You can copy the following given syntax example.

netsh interface ipv4 set dns name=”Wi-Fi” static


Syntax for secondary DNS server setting

change ip address and dns servers


change ip address and dns servers

You can copy the following given syntax example.

netsh interface ip add dns name=”Wi-Fi” static index=2


This simple utility will be very helpful to modify your network configuration. Try this netsh command and let us know about your experience via comments. We will keep on updating you about various tweaks and tricks used on the computer.


Leave a Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.