Configuring IP address in a Windows with CMD performed using netsh command line utility. The network shell (netsh) is a set of commands that help you configure any Windows operating system IP address, Network Interfaces, and Windows Firewall. The usage of the command line is for pro level Windows users. Those who are playing the network infrastructure configuration. But using the command line as normal Windows user indicate your expertise to Windows environment. If you are new to Windows command line, this article “configure IP address with command prompt in Windows 10” will help you begin using command line interface.
Configuring Windows IPv4 Networking with Netsh or Network Shell. Netsh is a command-line utility included in Microsoft’s Windows NT line of operating systems beginning with Windows 2000. It allows local or remote configuration of network devices such as the NICs.
Configure IP Address with Command Prompt in Windows 10
Before setting IP address with cmd in Windows 10, you need to know how to find your IP address on Windows 10. So before everything, you must know the network IP address configuration on your system.
Let’s learn the process of IP configuration step by step. I am going to explain it with an easy pictorial guide. If you don’t understand some part, just kindly comment us and ask your questions.
The process of Changing Windows 10 IP Address with Command Prompt:
- Find your IP address in Windows 10.
- View network interfaces card.
- Change IP address on Windows 10.
- Change DNS IP address with the command line.
- Reset IP address with Command Prompt.
How to Find your IP Address on Windows 10?
There are many options for finding IP address on Windows 10. The easy one is “ipconfig” command. To find your IP address on Windows 10, just type “ipconfig” in command prompt. To do this process:
- Press Windows+R keys to open the Run.
- Type “cmd” in the run and press enter.
- Now type “ipconfig” to show the IP address.
The “ipconfig” command shows everything about your computer network interfaces. You might have many physical or virtual network interface card.
Here, I just have one network interface on my Windows 10 computer. The result of ipconfig command shows that the IP 169.254.29.130 with the mask of 255.255.255.0 is my current Windows IP address.
This is a class C “autoconfiguration IPv4”. When your system doesn’t find any DHCP Server or manual IP address, it obtains auto IP address. So let’s change it.
How to Change IP Address with Command Prompt?
For change IP address, open command prompt or PowerShell. Both works the same and you can run all command prompt commends on Powershell as well. Ok, run cmd or Powershell as administrator. Netsh work in both command prompt and Powershell. I’m using Windows Powershell to change IP address on Windows 10 completely. Becuase the user interface and color’s of Powershell is better than Command prompt.
- Type “Powershell” in Windows 10 search box to run Windows Powershell.
- You need to run Powershell as administrator. Just press Windows+Shift the press enter to run Powershell as administrator. Or right-click the Powershell and click Run as administrator.
To find the network interface with the command line, type the following command on Powershell.
Netsh interface ipv4 show interface
The result shows two network interfaces. The Loopback and the Ethernet. The Loopback is Windows builtin network loopback interface, but our pointed network interface is the ethernet.
To find your IP address in Windows 10 with netsh command, just type the following command.
netsh interface ipv4 show config
It displays all the network interface configuration. The output result is clear and better than output result of “ipconfig” command on Command prompt. So to find an exact information of the network interface, just add the index ID of the network interface at the end of the command.
netsh interface ipv4 show config 2
That’s good. Let’s configure and change Windows 10 IP address with the command line. The command is bit long but easy to understand. No need to remember, just try to understand the netsh command structure.
To change the IP address of the “Ethernet0” network interface, type the following command.
netsh interface ipv4 set address name=2 static 22.214.171.124 mask=255.255.255.0 gateway=126.96.36.199
Once the command executed successfully, check the result with “netsh interface ipv4 show config 2” command. Yes, the output result shows the exact IP address has set on the “Ethernet0” network interface. Now the Windows IP address is 188.8.131.52 with the mask of 255.255.255.0 and default gateway is 184.108.40.206.
Note: You can’t change the default gateway separately with the following command. It will remove the IP address and just set the default gateway address.
netsh interface ipv4 set address name=2 gateway= (Gateway IP Address)
That’s good and enough for IP address configuration in Windows 10 with the command line. Let’s change DNS IP address from the command line.
- Related: MCSA Lab Manual Articles.
How to Change DNS IP address from Command Prompt?
DNS IP address is the unique address in the network that resolves computer name to IP address and IP address to the computer name. In the network, finding a computer with a name is easy than 32-bit IPv4 address. To set or change the DNS IP address, just simply do it with the following command.
netsh interface ipv4 set dns name=2 static 220.127.116.11
You might see some error on a simple local network, because of not having a DNS server. When you don’t have a DNS server, it’s not necessary to set DNS IP address on your computer.
Finally, recheck the result with “netsh interface ipv4 show config 2” command. The output netsh command should be displayed with DNS IP address.
Configure IP address with command prompt in Windows has tow benefits. The first benefit of working with Windows command line helps get you improve your skills in Windows environment. The second benefit is command line is faster than GUI. If you work with the command line, you will understand the power of command line.
The Windows command line interface has improved a lot in Windows 10. Now you can find some Linux commands that run in Windows 10 and works the same on Linux. Finally, hope you learn how to configure IP address with Command Prompt in Windows operating systems. If you don’t understand, please ask us about how to configure IP address with command prompt in Windows 10?