sudo ipconfig set en0 DHCPRenew the DHCP lease on en0 (Wi-Fi on most Macs).
When to use it
Renew the lease when your Mac shows a self-assigned 169.254.x.x address, after an IP address conflict, after changing router settings, or when “connected but no internet” might be an address problem.
Steps
In System Settings
System Settings › Network › Wi-Fi › Details › TCP/IP › Renew DHCP Lease. The IP address may change.In Terminal
Use the interface name (en0 for Wi-Fi on most Macs).sudo ipconfig set en0 DHCPCheck the new lease
getpacket prints the DHCP details your router sent.ipconfig getpacket en0
Output explained
Relevant lines from ipconfig getpacket en0:
yiaddr = 192.168.1.23
lease_time (uint32): 0xe10
subnet_mask (ip): 255.255.255.0
router (ip_mult): {192.168.1.1}
domain_name_server (ip_mult): {192.168.1.1}
- yiaddr (“your IP address”) is the address assigned to your Mac.
- lease_time is in hexadecimal seconds: 0xe10 = 3600, one hour. Your Mac renews automatically halfway through.
- router and domain_name_server are the gateway and DNS server the router told your Mac to use.
Options and variations
| Flag | Meaning | Example |
|---|---|---|
| ipconfig set IF DHCP | Renew / switch to DHCP (sudo) | sudo ipconfig set en0 DHCP |
| ipconfig getpacket IF | Show the DHCP lease | ipconfig getpacket en0 |
| ipconfig getifaddr IF | Show only the IP | ipconfig getifaddr en0 |
Common errors
| Error | Cause | Fix |
|---|---|---|
| Still 169.254.x.x after renewing | The router's DHCP isn't answering | Restart the router; check its DHCP pool and MAC filtering. |
| getpacket prints nothing | No DHCP lease on that interface | Check the interface name with route -n get default. |
Do it in the app
After a renew, LightAtom's connections view shows your apps reconnecting.
Frequently asked questions
How do I renew my IP address on a Mac?
System Settings › Network › Wi-Fi › Details › TCP/IP › Renew DHCP Lease, or sudo ipconfig set en0 DHCP in Terminal.
Is there an ipconfig /release on Mac?
Not the Windows command. sudo ipconfig set en0 NONE releases the address and sudo ipconfig set en0 DHCP gets a new lease.
Will renewing the lease change my IP address?
Usually you get the same address back, since routers remember devices. With Private Wi-Fi Address set to Rotating, the router may see a new device and assign a new address.