Changing the IP Address in Windows 10 using CMD (Command Prompt) is very uncommon to do. Most Windows 10 users and maybe all Windows users prefer to change IP Address using Control Panel –> Network and Sharing Center or from Windows GUI option.
Even if it’s not a good choice, but it’s doable. In some circumstances, we can’t use the GUI feature of Windows so it’s become very difficult to change the IP Address. Then, changing the Windows IP Address using CMD is a good option to do in this situation.
Setting up Windows IP Address through CMD is more difficult and complicated to do, especially for newbies. Because we have to type the text commands in the Windows CMD one by one, where the order is quite long and hard to remember.
But you don’t need to worry, because in this article I will share some commands to change the IP address of your Windows computer easily and quickly.
Run CMD as Administrator
To be able to change the Windows 10 IP Address from CMD we definitely need to run the CMD application itself with administrator privilege. In Windows 10, you can open CMD as administrator using this method :
Click Start menu or hit the Windows key to open the Start Menu -> type CMD -> Run as Administrator
If you have an issue with your mouse, you can use the arrow keys on your keyboard to navigate the cursor to Run as Administrator section, and hit Enter.
How to See Network Configurations on Your Computer using CMD
Before you can change Windows IP Address through CMD, you must first know the network configuration on your computer’s Windows system. To do this, please type the command below in the CMD window:
netsh interface ipv4 show config
Pay attention to the interface name. In the picture above the interface name is Ethernet. This interface name will be used in the next command.
How to Change Windows IP Address Using CMD
To be able to change the IP address of a Windows computer using CMD, you must have executed the previous command to see the name of the interface you want to change. Next, please enter the command in the following format in the CMD application:
netsh interface ipv4 set address name="INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY
Examples of applying the command are as follows:
netsh interface ipv4 set address name="Ethernet" static 18.104.22.168 255.255.240.0 22.214.171.124
If there is an error message that appears on the CMD screen, please check the command that you entered. Make sure the command follows the format/syntax as explained above. After the command has been successfully executed and no error message appears, you can try to ping the gateway or IP on the Internet for example pinging 126.96.36.199. If successful, the command you entered is correct.
Keep in mind that if you can’t access or ping a particular domain for example debrislinux.org or google.com, it’s because the IP DNS is not yet set on the interface. To set the IP DNS on Windows using CMD you can follow the guide below.
How to Set Windows IP DNS Server Using CMD
By using the netsh command in CMD, we can also use it to change or add IP DNS Server to Windows. To change/add IP DNS Servers on Windows with CMD, please enter the command with the following format/syntax:
netsh interface ipv4 set dns name="INTERFACE NAME" static IP_DNS_SERVER
Examples of applying the command are as follows:
netsh interface ipv4 set dns name="Ethernet" static 188.8.131.52
If an error message appears on the CMD screen, please check the command that you entered, make sure it’s in the format/syntax. After executing the command and no error message appears, please try pinging the domain for example debrislinux.org or google.com. If the ping is successful, the command you entered is correct.
How to Configure Windows DHCP IP Address Using CMD
If your network uses DHCP Server to automatically obtain IP Address configuration on the client computer, then the above method cannot be used. To be able to get the IP Address, Subnetmask, Gateway and DNS Server configurations automatically from the DHCP Server, you must use the other commands as follows:
Setting DHCP Client Windows IP Address via CMD
netsh interface ipv4 set address name="Ethernet" source=dhcp
Setting IP DNS Server DHCP Client Windows via CMD
netsh interface ipv4 set dnsservers name="Ethernet" source=dhcp
Please modify the interface name in the command above according to the interface name that you want to change the settings to DHCP Client. If the command has been executed, the IP Address, Subnetmask, Gateway and IP DNS Server settings will be automatically assigned to your computer. You don’t need to set the IP Address configurations manually.
Changing the Windows 10 IP Address can be done using the menu in Control Panel -> Network and Sharing Center or the Windows GUI option. But we can also use the Command Prompt (CMD) app to change the IP Address and IP DNS Server configuration in Windows.
The netsh command can be used to configure static IP Addresses and DNS Servers. It is also can be used to configure the IP Address configuration automatically by enabling DHCP Client settings that will automatically configure IP Address, Subnetmask, Gateway and DNS Server from DHCP Server. So, you don’t need to set it manually.
To be able to use the netsh command both to change the IP Address configuration and DNS Server, you must know the name of the interface that you want to change the configuration.
If there is an error message on the CMD screen when executing the command, double-check the command you entered. Make sure it matches the format provided and there are no typos in the command.