keepcalculator

06 Numbers and Powers

Release Renew DHCP Command Line ipconfig?

Card No. 06·67598 · Updated · Standard formula, shown below

To release and renew your IP address from the command line in Windows, you use the ipconfig command: first run ipconfig /release to drop the current DHCP lease, then run ipconfig /renew to request a new one. These commands work on all modern Windows versions (7 through 11) and are the standard way to force a fresh IP address from your router or ISP without rebooting.

What DHCP and ipconfig Actually Do

DHCP (Dynamic Host Configuration Protocol) is how your computer automatically gets an IP address, subnet mask, default gateway, and DNS servers from a router or ISP server. Instead of typing these numbers manually, your device sends a broadcast request and the DHCP server assigns a lease — usually for 24 hours, though it can be shorter or longer depending on the network. The ipconfig command is the built-in Windows tool for viewing and managing these network settings. When you run ipconfig alone, it shows your current IPv4 address, subnet mask, and default gateway for each active adapter. Adding /all gives you far more detail: MAC address, DHCP lease obtained and expiration times, DNS server addresses, and whether DHCP is enabled.

Step-by-Step: Release and Renew

Here is the exact process, which requires an administrator Command Prompt:

  1. Press Windows Key + X and select Terminal (Admin) or Command Prompt (Admin).
  2. Type ipconfig /release and press Enter. This immediately drops your current IP lease. Your connection will show as “Media disconnected” or an address like 0.0.0.0.
  3. Wait a few seconds, then type ipconfig /renew and press Enter. This sends a new DHCP request and typically takes 5–20 seconds.
  4. Type ipconfig to verify your new IP address and confirm the lease was renewed.

If you only need to renew one adapter (for example, your Wi-Fi but not Ethernet), specify it: ipconfig /release "Wi-Fi" and ipconfig /renew "Wi-Fi". The adapter name must match exactly what appears in ipconfig (including quotes if it has a space).

Why You Might Need to Do This

There are several common reasons to release and renew your IP address:

  • Network troubleshooting: If you have no internet access but the network icon shows connected, a stale or conflicting IP lease is a frequent culprit.
  • Changing networks: Moving between home, work, or public Wi-Fi can leave your device holding an old lease that no longer matches the new network.
  • Getting a new IP from your ISP: If you want to bypass a temporary block or just force a fresh address, renewing often works — though many ISPs assign the same IP again.
  • Fixing IP conflicts: When two devices on the same network end up with the same IP, renewing one of them usually resolves the “Address already in use” error.
  • After changing router settings: If you reconfigured DHCP settings (like the address range), renewing ensures your device picks up the new configuration.

Common Problems and How to Fix Them

Sometimes the release/renew process doesn’t go smoothly. Here are the most frequent issues and their solutions:

  • “An error occurred while renewing interface” — This usually means the DHCP server is unreachable. Check that your Wi-Fi or Ethernet cable is connected, restart your router, and try again.
  • Renew takes forever or times out — Your router may be overloaded or the DHCP pool exhausted. Restart the router, or reduce the number of connected devices.
  • You get a 169.254.x.x address — This is an Automatic Private IP Address (APIPA), meaning no DHCP server was found. Verify your network cable, Wi-Fi password, and router status.
  • Release drops your connection and renew fails — In this case, run ipconfig /renew again after a minute, or restart the adapter with netsh interface set interface "Wi-Fi" disabled then enabled (requires admin).
  • You still have the same IP after renew — This is normal. The DHCP server often assigns the same address if it’s still available. To get a different one, you may need to release, wait for the lease to expire (or release from the router), then renew.

Alternatives to ipconfig /release and /renew

If the command line isn’t your preference, or if ipconfig doesn’t work, there are other methods:

  • Windows Settings: Go to Settings > Network & Internet > Wi-Fi (or Ethernet), click your connection, and toggle “IP assignment” from DHCP to Manual and back, or click “Edit” next to IP assignment and set it to Automatic. This effectively releases and renews.
  • Netsh command: netsh interface ip set address name="Wi-Fi" source=dhcp forces the adapter back to DHCP, which acts like a renew.
  • Restart the adapter: Disable and re-enable the network adapter in Control Panel or via Device Manager. This automatically releases the old lease and requests a new one.
  • Restart your computer or router: A full reboot clears the network stack and often resolves deeper issues that ipconfig can’t.
  • For Mac or Linux: Use sudo ipconfig set en0 DHCP (macOS) or sudo dhclient -r then sudo dhclient (Linux).

Is It Safe? What Are the Risks?

Running ipconfig /release and /renew is completely safe and non-destructive. It does not change any permanent settings, only your current DHCP lease. The worst that can happen is a temporary loss of network connectivity (usually a few seconds) or, in rare cases, you end up with a different IP than before. There is no risk of data loss, and your computer’s configuration files are untouched. However, note that if you are connected via a VPN, releasing your IP may disconnect the VPN tunnel because the underlying adapter changes. Also, if you are on a network that requires a specific IP (e.g., a static IP set by your IT department), releasing and renewing may fail or break connectivity — in that case, check with your network administrator before doing this.

Frequently Asked Questions

Do I need to run ipconfig /release before /renew?

No, you can run ipconfig /renew alone, and it will request a new lease while keeping your current one until the new one is assigned. However, running /release first forces the server to free your old IP, which can help if you’re getting a conflict or want a different address. In practice, running both in sequence is the most reliable way to force a fresh lease.

Why does my IP address not change after renew?

Most DHCP servers try to give you the same IP you had before, as long as it’s still available. This is called a “graceful renewal” and is by design to keep connections stable. To get a genuinely different IP, you can release, wait for the lease to expire (or manually clear it on the router), or change your device’s MAC address (not recommended for most users).

Can I use ipconfig /release on a remote computer?

No, ipconfig only works on the local machine. To release and renew on a remote computer, you’d need remote administration tools like PowerShell Remoting or PsExec, and you’d run the command in that remote session. There’s no built-in way to do it directly from your own command line.

What does “Media disconnected” mean after /release?

It means the adapter has no IP address because you just released it. This is normal and expected. After you run ipconfig /renew, the adapter should reconnect and show a valid IP. If it stays disconnected, check your physical connection or Wi-Fi.

Is there a single command to release and renew at once?

No, Windows doesn’t have a built-in one-liner. But you can create a batch file with two lines: ipconfig /release and ipconfig /renew, then run it as administrator. Some users also use ipconfig /renew alone, which effectively does both in one step.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →