By the following simple commands we can change IP address easily through Command Prompt [CMD]
so lets begin and open cmd command prompt by pressing windows button + R and type CMD on the prompted dialox Box
There are two requirements for changing your IP address, One for your IP address, Subnet Mask, and Default Gateway and another for DNS settings. We are going to use netsh command for changing the IP address So you the following exact command as it is given 🙂
netsh interface ip set address name = ” Local Area Connection ” static 192.168.0.1 255.255.255.0 192.168.0.254
The above IP address will take place as in:
- Local Area Network is the name of the interface that we want to change the IP address.
- We want to assign statistically an IP address of 192.168.0.1
- We want to set the subnet mask of 255.255.255.0
- We want to set default geteway of 192.168.0.254
with the above information we can easily switch the settings that are suited for our network. you might be thinking how can we go with the static IP that is already in use for getting and address from DHCP…so in that case we have to look for following command :-
netsh interface ip set address name=”Local Area Connection” Source=dhcp
For DNS modification we have to change only two Settings, Primary and Socondary DNS server, to set primary DNS server we will use the following command :-
netsh interface ip set dns name=”Local Area Connection” static 192.168.0.250
The above Command address will reflect as:-
- Local Area Network is the name of the interface of which we want to change the primary DNS setting.
- 192.168.0.250 is the IP address of the DNS server.
- specify the following Index Parameter to change the IP address of the secondary DNS server:
netsh interface ip add dns name=”Local Area Connection” 8.8.8.8 index=2
The above command wil set your network adapter named Local Area Connection to use Secondary DNS server address of 8.8.8.8{Its a Google’s public DNS server} now the last step is to set our DNS setting to be assigned dynamically which can be done by the following command:-
netsh interface ip set dnsservers name=”Local Area Connection” source=dhcp
That’s all 🙂 !!!!