Firgoos.com-How to change the IP address on your PC/laptop using a command prompt is very easy and quick, different than using a control panel that many clicks require time so it is less efficient. Fo
r fans of Command Prompt, changing the IP address on a PC/laptop can be solved more quickly using Netsh command, which is one kind of a great network utility in Windows. The N
etsh command allows you to configure almost all aspects of a network connection in Windows. To do this, you must open a Command Prompt with administrative privileges.
- In Windows 10 or 8.1, right-click the Start menu (or press Windows + X on your keyboard) then select "Command Prompt (Admin)."
- In earlier versions of Windows, search on the Start menu for "command Prompt" and then right-click the result and select "Run as Administrator."
How to view Computer network information B
efore your IP address and related information change, then you should find the full name of the network for the interface that you want to change. To do this, type the following command:
netsh interface IPv4 show config
Scroll down until you see the interface you're looking for. In our example, we will modify the Wi-Fi interface, which on our machine is simply named "Wi-Fi." You will also see other default names that Windows set for the interface, such as "Local Area Connection," "Local Area Connection * 2," and "Ethernet." Just find what you're looking for and note the exact name. You can also copy and paste the name into Notepad and then return to Command Prompt later to simplify. To change the
IP address, Subnet Mask, and Default Gateway After the
computer network information is known, you are ready to change the IP address, Subnet Mask, and Gateway. To do this, you will type the command using the following syntax:
netsh interface ipv4 set address name = "YOUR INTERFACE NAME" Static IP_ADDRESS SUBNET_MASK GATEWAY
For example, your command might look like the following:
netsh interface ipv4 set address name = "Wi-Fi" Static 192.168.3.8 255.255.255.0 192.168.3.1
Where the information will be replaced according to what you want to use. In this example, a description of the command that we use as the following:
- Using the interface name "Wi-Fi"
- Set IP address to 192.168.3.1
- Set the subnet mask to 255.255.255.0
- Set the default gateway to 192.168.3.1
And if you use a static IP address but want to switch using an IP address that is automatically assigned by a DHCP server-like your router-you can use the following command:
netsh interface ipv4 set address name = "YOUR INTERFACE NAME" Source = DHCP
How to change Your Computer's DNS
settings you can also use the Netsh command to change the DNS server used by the network interface. Third-party DNS servers – such as Google Public DNS and OpenDNS – can become faster and more reliable than the DNS servers provided by your ISP. Like any of your reasons, changing the DNS server can be done on the router thereby affecting all devices that get information from the router or on individual devices. If you want to change the DNS server for only one PC, it is easy to do with the Nets
h command. You must use this command twice: the first to set your primary DNS server and the second to set your secondary or backup DNS server. To s
et up your primary DNS server, use the following syntax:
netsh interface ipv4 set dns name = "YOUR INTERFACE NAME" Static DNS_SERVER
So, for example, your command might look like the following (where we set it to Google's main public DNS server, 126.96.36.199):
netsh interface ipv4 set dns name = "Wi-Fi" Static 188.8.131.52
To set up your secondary DNS server, you will use a very similar command:
netsh interface ipv4 set dns name = "YOUR INTERFACE NAME" static DNS_SERVER index = 2
Continuing with the above example, you can set your secondary DNS as a public Google DNS secondary server, i.e. 184.108.40.206:
netsh interface ipv4 set dns name = "Wi-Fi" static 220.127.116.11 index = 2
And as is the case with changing the IP address, you can also change it so that the network interface retrieves its DNS settings automatically from the DHCP server. Just use the following command:
netsh interface ipv4 set dnsservers name "YOUR INTERFACE NAME" Source = dhcp.