ip release is the operation of terminating a DHCP lease and discarding the assigned IP address on a network interface, executed via ip addr flush or dhclient -r on Linux and ipconfig /release on Windows.
# Linux – Flush all IPv4 addresses from interface
ip addr flush dev eth0
# Linux – Release DHCP lease (dhclient)
dhclient -r eth0
# Windows – Release IP for all adapters
ipconfig /release
# Windows – Release IP for a specific adapter
ipconfig /release "Ethernet0"
Syntax
Tested on Ubuntu 22.04 with iproute2 5.15 and dhclient 4.4.3; Windows 10 22H2.
All commands require elevated privileges: sudo on Linux, Run as Administrator on Windows.
Options and Flags
| Flag / Option | Type | Default | Description |
|---|---|---|---|
ip addr flush dev <iface> |
Linux iproute2 | N/A | Removes all IP addresses from the specified interface. |
dhclient -r <iface> |
Linux DHCP client | N/A | Releases the current DHCP lease for the interface. |
ipconfig /release [adapter] |
Windows | All adapters | Sends a DHCPRELEASE message and discards the IP configuration. Optional adapter name narrows scope. |
sudo (Linux) |
Privilege escalation | Required | Both ip addr flush and dhclient -r require root privileges. |
Run as administrator (Windows) |
Privilege escalation | Required | Command Prompt must be launched with admin rights for ipconfig /release. |
Usage Examples
1. Release all IPv4 addresses on Linux to force DHCP renewal
sudo ip addr flush dev eth0
sudo dhclient eth0
This sequence drops the current IP and immediately requests a new lease. Useful when migrating subnets or after a DHCP scope change. The interface will be briefly unreachable.
2. Release a specific adapter on Windows to troubleshoot IP conflict
ipconfig /release "Wi-Fi"
Running this as an administrator sends a DHCPRELEASE for the Wi-Fi adapter only. The adapter loses its IP, gateway, and DNS servers. Combine with ipconfig /renew "Wi-Fi" to restore connectivity.
3. Combine release and renew in a single batch (Windows)
ipconfig /release && ipconfig /renew
One-liner for quick troubleshooting. The && ensures /renew only runs after /release succeeds. Adding a delay (timeout /t 2) improves success rate in busy networks.
Troubleshooting & Common Errors
| Error Message | Root Cause | Resolution Command |
|---|---|---|
ip: RTNETLINK answers: Operation not permitted |
Missing root privileges on Linux. | Prepend sudo: sudo ip addr flush dev eth0 |
dhclient: No DHCP client running |
dhclient daemon not active or interface not managed by DHCP. | Start sudo dhclient eth0 to run the client in foreground; or restart the service. |
ipconfig /release – The requested operation requires elevation. |
Command Prompt not running as Administrator. | Launch CMD as Administrator (right-click → Run as administrator). |
An error occurred while releasing interface Lo: An address has not yet been associated with the network endpoint. |
Loopback adapter selected; only physical/virtual adapters can release DHCP leases. | Specify the correct adapter name: ipconfig /release "Ethernet" |
Performance Considerations
ipconfig /release sends a DHCPRELEASE packet with no retry. In scripted environments, use timeout /t 2 or schedule via at to avoid hanging. Release packets are tiny (< 300 bytes), so MTU is irrelevant. For remote execution, at decouples release from the script, avoiding psexec limitations with &&. Example stagger:
@echo off
at \machineA 12:59 ipconfig /release
at \machineB 13:01 ipconfig /release
at \machineC 13:03 ipconfig /release
timeout /t 120
psexec \machineA -d ipconfig /renew
psexec \machineB -d ipconfig /renew
psexec \machineC -d ipconfig /renew
Frequently Asked Questions
What is the difference between ipconfig /release and ipconfig /renew?
Answer: ipconfig /release sends a DHCPRELEASE packet and sets the IP to 0.0.0.0. ipconfig /renew broadcasts a DHCPDISCOVER. Run them sequentially (ipconfig /release && ipconfig /renew) to obtain a fresh IP address. Use /release6 for IPv6.
When should I use the /release6 flag in ipconfig?
Answer: Use ipconfig /release6 to release only the IPv6 DHCPv6 lease without affecting IPv4. On dual-stack networks, ipconfig /release releases both. To preserve IPv4 while renewing IPv6, run ipconfig /release6 && ipconfig /renew6. Verify with ipconfig /all.
How do I fix ‘An error occurred while releasing interface’ on Windows?
Answer: Run Command Prompt as Administrator, disable the adapter with netsh interface set interface "Ethernet" admin=disable, then re-enable. If persistent, reset TCP/IP: netsh int ip reset and netsh winsock reset. Reboot and retry.
Does ipconfig /release work on AWS EC2 Windows instances?
Answer: No. AWS ignores DHCPRELEASE packets. Instead, use the AWS CLI: aws ec2 assign-private-ip-addresses. On Linux, dhclient -r also fails; use ip addr flush but note it only disrupts connectivity, it does not free Elastic IPs.
What is the fastest way to release all IP addresses on a Windows machine with a single command?
Answer: Run ipconfig /release * to release all adapters, including virtual ones. For selective release, use ipconfig /release "Wi-Fi". Renew with ipconfig /renew *. On Linux, dhclient -r or ip addr flush dev *.

Command Line Expert & Software Engineer
Welcome! I’m Thomas Heinrich, a software engineer and system administrator with a deep passion for the Command Line Interface (CLI). With years of experience navigating the terminal, building backend architectures, and automating server deployments, I created this space to share practical, real-world terminal knowledge.
Whether you are a beginner taking your first steps in a Linux environment or a seasoned DevOps engineer looking to optimize your deployment scripts, you will find actionable solutions here. My goal is to help you ditch the mouse, speed up your workflow, and harness the full power of the command line.