Instructions to change IP address from Command Prompt

To change the IP address on the computer is not difficult, you can use Control Panel. However, you may not know that using Command Prompt can also change the IP address. Especially using the Command Prompt to change the IP address is much faster than using Control Panel.

To change the IP address on the computer is not difficult, you can use Control Panel. However, you may not know that using Command Prompt can also change the IP address. Especially using the Command Prompt to change the IP address is much faster than using Control Panel.

Picture 1 of Instructions to change IP address from Command Prompt

The netsh command allows you to configure some settings of the network connection on the Windows operating system. However, this process requires Command Prompt under Admin.

To open the Command Prompt under Admin:

On Windows 10 or Windows 8.1, right-click the Start button on the Taskbar or press the Windows + X key combination to open Power User Menu, here you click Command Prompt (Admin).

On previous versions, you enter the command prompt into the Search box on the Start Menu, then on the search results list, right-click the Command Prompt and select Run as Administrator.

View network connection information:

Before proceeding to change the IP address and related information, you need to find the full name of the network connection you want to change. To do this you use the command:

netsh interface ipv4 show config

Picture 2 of Instructions to change IP address from Command Prompt

Scroll down to find it until you find the interface you want to find. In the example above, Network Administrator modifies Wifi interface, so we proceed to find Wifi. Also see other default names that Windows assigns on interfaces, such as Local Area Connection, Local Area Connections * 2 and Ethernet.

Just find the correct network connection name and copy and paste it into Notepad to use in the next steps.

Change IP address, Subnet Mask and Default Gateway:

To change the IP address, Subnet Mask and Default Gateway , you use the command:

netsh interface ipv4 set address name = static "YOUR INTERFACE NAME" IP_ADDRESS SUBNET_MASK GATEWAY

Suppose you enter the statement as:

netsh interface ipv4 set address name = "Wi-Fi" static 192.168.3.8 255.255.255.0 192.168.3.1

In the command in the example above, replace the information:

- Interface name is Wifi

- Set IP address to 192.168.3.1

- Set the Subnet mask to 255.255.255.0

- Set the Default Gateway to 192.168.3.1

And if you use a static IP address but you want to switch using an IP address automatically assigned by the DHCP server, such as a router, you can use the following command:

netsh interface ip4 set address name = 'YOUR INTERFACE NAME' source = dhcp

Change DNS Settings:

Alternatively, you can use the netsh command to change DNS servers. Third-party DNS Server applications such as Google Public DNS and OpenDNS can support faster and more reliable DNS servers provided by ISPs.

Whatever the purpose of changing your DNS server, you can do it on the router. If you want to change the DNS server of a computer, you can easily do so with the netsh command.

You will have to use two commands: a command to set up the primary DNS server and a command to set up a secondary DNS server or backup a DNS server .

To set up a primary DNS server , use the command:

netsh interface ipv4 set dns name = "YOUR INTERFACE NAME" static DNS_SERVER

Suppose if you set Google's primary public DNS server, 8.8.8.8 you use the command:

netsh interface ipv4 set dns name = "Wi-Fi" static 8.8.8.8

To set up a secondary DNS Server , use the command:

netsh interface ipv4 set dns name = "YOUR INTERFACE NAME" static DNS_SERVER index = 2

Suppose if you wanted to set the secondary DNS of the Google Public DNS secondary server to 8.8.4.4 you would use the command:

netsh interface ipv4 set dns name = "Wi-Fi" static 8.8.4.4 index = 2

With IP address, you can change to set DNS automatically. Use the command:

netsh interface ipv4 set dnsservers name "YOUR INTERFACE NAME" source = dhcp

Refer to some of the following articles:

  1. Disable IPv6 to troubleshoot Internet connectivity issues on Windows computers
  1. Here's how to check if your IP address is static or dynamic
  1. Conflict of IP address error when connecting to Wifi on iPhone, iPad, this is a fix

Good luck!

Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile