Home » How To » How to Change IP Address in Command Prompt (Renew IP)

How to Change IP Address Using Command Prompt

It’s not often but there will be situations where you need to manually change your IP address or renew the current one to get a new IP. For example, maybe you want to use a specific static IP address (on Windows 10), bypass IP-based restrictions, resolve IP conflicts on a local network, or simply troubleshoot network problems.

Whatever the reason, Windows gives you multiple ways to change the IP address by setting up a static IP or renewing the IP address to get a new one using DHCP. In this tutorial, I will show the simplest way to update or change your IP address in Windows using the Command Prompt. Specifically, using the netsh command. This method works for Windows 10 and Windows 11. Let’s get started.

Before You Start

  • You need administrator rights to change the IP address using the Command Prompt in Windows.
  • If you want to set a specific IP address, you also need subnet mask and gateway addresses. You can get these details from your router, network administrator, or Internet Service Provider (ISP).

Steps to Change IP Address Using Command Prompt

  1. Press the Start button on the taskbar.
  2. Search for Command Prompt in the search bar.
  3. Click the Run as Administrator option.
  4. Run the following command to list your network adapters.
   netsh interface ipv4 show config
  1. From the list, note down the network adapter (interface) name for which you want to change the IP address.
  2. Next, run the following command while replacing “Interface_Name,” IP_ADDRESS”, “SUBNET_MASK”, and “GATEWAY” with the actual interface name, the IP address you want to assign, subnet mask, and gateway respectively.
   netsh interface ipv4 set address name="Interface_Name" static IP_ADDRESS SUBNET_MASK GATEWAY
  1. If you want to make Windows get a new IP address automatically, run the following command instead. As before, replace “Interface_Name” with the actual interface name.
   netsh interface ipv4 set address name="Interface_Name" source=dhcp
  1. After assigning the IP address, close the command prompt window.

Detailed Steps (With Screenshots)

First, open the Command Prompt program as an administrator. To do that, search for “Command Prompt” in the Start menu and click the “Run as Administrator” option.

Once it opens, run the following command to list all the network adapters (network interfaces) on your computer.

netsh interface ipv4 show config
Change-ip-address-in-command-prompt-040920

From the list, note down the name of the network adapter for which you want to change the IP address.

Once you have the adapter/interface name, run the following command depending on how you want to change the IP.

  • To set a specific IP address, run the below command while replacing “Interface_Name,” IP_ADDRESS”, “SUBNET_MASK”, and “GATEWAY” with the actual interface name, the IP address you want to assign, subnet mask, and gateway respectively.
netsh interface ipv4 set address name="Interface_Name" static IP_ADDRESS SUBNET_MASK GATEWAY
  • To make Windows renew the IP address, run the following command. It uses DHCP to renew or get a new IP address. Don’t for get to replace “Interface_Name” with the actual interface name.
netsh interface ipv4 set address name="Interface_Name" source=dhcp

As soon as you execute the command, Windows changes the IP address. You can safely close the Command Prompt window by clicking the X icon on the title bar.

Verifying the IP Change

To confirm that your IP address has been successfully changed, you can use the following command in Command Prompt:

ipconfig /all

This will display detailed information about all your network interfaces, including the new IP address.

Wrapping Up — Changing Windows IP Address Using Command Prompt

As you can see, thanks to the netsh command line tool, you can easily change the IP address in Windows to set a specific IP or renew the IP using DHCP. This can be useful for troubleshooting network issues, bypassing IP-based restrictions, or setting up a static IP for file sharing.

Remember that if you are setting a specific IP, you also need to enter the subnet mask and gateway details. You can get these from your router, network administrator, or ISP. Also, keep in mind that changing your IP address may temporarily affect your network connectivity.

If you have any questions or need help, comment below. I’ll be happy to assist. If you like this article, check out how to change the network name in Windows 10.

Leave a Comment

Your email address will not be published. Required fields are marked *