Renew the DHCP lease
Medium risk
What do risk levels mean?
- Read-only
- Inspects state without changing anything.
- Low risk
- Reversible with a routine follow-up command.
- Medium risk
- Changes state; undo path documented.
- Destructive
- Deletes or overwrites; confirmation required.
Releases the current DHCP lease and requests a new one, which briefly drops connectivity — the standard fix for a stale or self-assigned (169.254.x.x) address after switching networks.
networkdhcpipinterface
Parameters
Network interface to renew (macOS/Linux only, for example en0 or eth0).
Commands
Inspect the current address before renewing
ipconfig getifaddr en0Restart DHCP on the interface to request a fresh lease
sudo ipconfig set en0 DHCPVerification
nslookup example.comThe interface has a routable address again and name resolution succeeds.
Undo
Not undoable
The previous lease cannot be restored, and does not need to be — the interface simply holds whichever lease the DHCP server granted.
Pitfalls
- Connectivity drops for a few seconds during renewal; do not run this over a remote session on the same interface, or you will disconnect yourself.
- On Linux systems using NetworkManager, prefer "nmcli device reapply <interface>"; dhclient may not be installed or may conflict with it.
- macOS interface names vary (en0 is typically Wi-Fi on laptops); list interfaces with "networksetup -listallhardwareports" first.