Set IP via command prompt with "netsh"

Set IP via command prompt with "netsh"
Photo by U. Storsberg / Unsplash


1. Start the command prompt with "Run as administrator".

  1. Check the current interface on this computer.
netsh interface show interface
  1. Check current IP setting for each interface (This sample focus on Wi-Fi interface).
ipconfig /all
  1. Set IP by "netsh" command.
netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY

netsh interface ipv4 set address name=vEthernet (External-Wi-Fi)" static 192.168.203.10 255.255.255.0 192.168.203.235
  1. Check for new IP was settled.
ipconfig /all
  1. Change DNS by command.
netsh interface ipv4 set dns name="YOUR INTERFACE NAME" static DNS_SERVER

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

  1. Set secondary DNS.
netsh interface ipv4 set dns name="YOUR INTERFACE NAME" static DNS_SERVER index=2

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