How to change IP address from command prompt?

nareen123 Posts 10 Registration date Tuesday April 15, 2008 Status Member Last seen May 29, 2009 - Updated on Jan 19, 2019 at 12:32 AM
netguy2000 Posts 1 Registration date Wednesday November 28, 2012 Status Member Last seen November 28, 2012 - Nov 28, 2012 at 12:53 AM

Is there any way to change IP address of the computer from Command prompt? I use WinXP as OS and I would like to know if I can change IP from command prompt.

Please help me out.
System Configuration: Windows XP Internet Explorer 6.0

11 responses


You can change the IP from the command prompt. Here are the commands:
  • To change IP and default gateway:

netsh int ip set address "local area connection" static 1
  • To change DNS:

netsh int ip set dns "local area connection" static primary

This is assuming 3 things.
  • 1) The network adapter you're trying to change the IP for is "local area connection". It could also be "local area connection 2" or "wireless network connection". Look in your control panel for the correct name
  • 2) The IP you want to set is, change this to whatever IP to want to use.
  • 3) The default gateway and DNS are the same IP. If you are using some kind of router they usually are. Change this to match your network config found with the command ipconfig /all

You will need to run both commands to change the IP.

Hope, it works!
Thats of great help. Thanks a bunch and keep up the great work