How to change IP address and DNS of computer from command prompt
November 1, 2008 by John Tran · Leave a Comment
Here is the command for those who want to change the IP address and DNS of a computer via command prompt.
Command to change IP
netsh int ip set address “local area connection” static 192.168.0.101 255.255.255.0 192.168.0.254 1.
Command to change DNS
netsh int ip set dns “local area connection” static 192.168.0.254 primary
Both commands are assuming that you want to change your IP to 192.168.0.101, your default gateway is 192.168.1.254, your DNS is 192.168.0.254 and the name of the network adapter is ‘local area connection.’ You will need to change these values according to your own network.