Instructions to change IP address from Command Prompt
To change the IP address on the computer is not difficult, you can use Control Panel. However, you may not know that using Command Prompt can also change the IP address. Especially using the Command Prompt to change the IP address is much faster than using Control Panel.
The netsh command allows you to configure some settings of the network connection on the Windows operating system. However, this process requires Command Prompt under Admin.
To open the Command Prompt under Admin:
On Windows 10 or Windows 8.1, right-click the Start button on the Taskbar or press the Windows + X key combination to open Power User Menu, here you click Command Prompt (Admin).
On previous versions, you enter the command prompt into the Search box on the Start Menu, then on the search results list, right-click the Command Prompt and select Run as Administrator.
View network connection information:
Before proceeding to change the IP address and related information, you need to find the full name of the network connection you want to change. To do this you use the command:
netsh interface ipv4 show config
Scroll down to find it until you find the interface you want to find. In the example above, Network Administrator modifies Wifi interface, so we proceed to find Wifi. Also see other default names that Windows assigns on interfaces, such as Local Area Connection, Local Area Connections * 2 and Ethernet.
Just find the correct network connection name and copy and paste it into Notepad to use in the next steps.
Change IP address, Subnet Mask and Default Gateway:
To change the IP address, Subnet Mask and Default Gateway , you use the command:
netsh interface ipv4 set address name = static "YOUR INTERFACE NAME" IP_ADDRESS SUBNET_MASK GATEWAY
Suppose you enter the statement as:
netsh interface ipv4 set address name = "Wi-Fi" static 192.168.3.8 255.255.255.0 192.168.3.1
In the command in the example above, replace the information:
- Interface name is Wifi
- 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 you want to switch using an IP address automatically assigned by the DHCP server, such as a router, you can use the following command:
netsh interface ip4 set address name = 'YOUR INTERFACE NAME' source = dhcp
Change DNS Settings:
Alternatively, you can use the netsh command to change DNS servers. Third-party DNS Server applications such as Google Public DNS and OpenDNS can support faster and more reliable DNS servers provided by ISPs.
Whatever the purpose of changing your DNS server, you can do it on the router. If you want to change the DNS server of a computer, you can easily do so with the netsh command.
You will have to use two commands: a command to set up the primary DNS server and a command to set up a secondary DNS server or backup a DNS server .
To set up a primary DNS server , use the command:
netsh interface ipv4 set dns name = "YOUR INTERFACE NAME" static DNS_SERVER
Suppose if you set Google's primary public DNS server, 8.8.8.8 you use the command:
netsh interface ipv4 set dns name = "Wi-Fi" static 8.8.8.8
To set up a secondary DNS Server , use the command:
netsh interface ipv4 set dns name = "YOUR INTERFACE NAME" static DNS_SERVER index = 2
Suppose if you wanted to set the secondary DNS of the Google Public DNS secondary server to 8.8.4.4 you would use the command:
netsh interface ipv4 set dns name = "Wi-Fi" static 8.8.4.4 index = 2
With IP address, you can change to set DNS automatically. Use the command:
netsh interface ipv4 set dnsservers name "YOUR INTERFACE NAME" source = dhcp
Refer to some of the following articles:
- Disable IPv6 to troubleshoot Internet connectivity issues on Windows computers
- Here's how to check if your IP address is static or dynamic
- Conflict of IP address error when connecting to Wifi on iPhone, iPad, this is a fix
Good luck!
You should read it
- How to change the IP address for the phone
- How to Refresh IP Address
- How to Change MAC Address on Windows
- How to change DNS server on the most popular routers
- What is a static IP address?
- How to change MAC addresses on Windows, Linux and MAC OS X
- Primary key PRIMARY KEY in SQL Server
- How to Change IP Address on Mac
- 3 ways to change the Mac address on Windows 7/8 / 10
- How to find, set and change IP addresses on Linux
- 3 'legitimate' reasons to change DNS Server
- How to change the primary email address for a Microsoft account
Maybe you are interested
How to use the file search command on Windows, find saved files
Why is tldr command better than man command in Linux?
Should I use PowerShell or Command Prompt?
What to do when open command window here does not appear?
How to switch users on the Linux command line
How to fix Mac Homebrew error 'zsh: command not found: brew'