Mac Won't Connect to Wi-Fi Network: DHCP Lease Renewal Fix
🚨 Symptoms & Diagnosis¶
When your Mac struggles with Wi-Fi connectivity, especially after waking from sleep or experiencing intermittent drops, a common culprit is issues with its DHCP lease renewal process. Look out for these tell-tale signs:
- Wi-Fi is connected, but no internet access. Your Wi-Fi icon shows full bars, but no traffic flows.
- Self-Assigned IP address assigned (169.254.x.x). Instead of a valid IP from your router (e.g., 192.168.x.x), your Mac gets an unusable "link-local" address.
- Network connection lost after sleep/wake. Connectivity drops consistently when your Mac resumes from sleep.
- Console/System Log entries indicating DHCP failures:
(Note:
dhcp lease expired no response from DHCP server in /var/log/system.log configd[xx]: DHCP en0: Renew timeouten0typically refers to the Wi-Fi interface).
Root Cause: These issues frequently stem from DHCP lease expiration without proper auto-renewal due to short server lease times, network instability, corrupted DNS cache, or misconfigured network preferences (
preferences.plist) preventing successful lease handshakes. A misconfigured DHCP Client ID can also lead to the server rejecting renewal requests.
🛠️ Solutions¶
Renew DHCP Lease (Quick Fix)¶
This immediate mitigation forces your Mac to request a new IP address and DHCP lease from the network, often resolving temporary glitches.
Immediate Mitigation: Renew DHCP Lease via System Settings
This approach is useful for quickly re-establishing a connection without deep-diving into configuration files.
- Go to the Apple menu () > System Settings.
- In the sidebar, click Network.
- Select Wi-Fi from the list of network services.
- Click the Details... button next to your active Wi-Fi connection.
- In the pop-up window, navigate to the TCP/IP tab.
- Click Renew DHCP Lease.
- Click OK to apply the changes.
Set DHCP Client ID and Flush Network Caches (Best Practice Fix)¶
For more robust and reliable Wi-Fi connectivity, especially for recurring DHCP issues, it's best to configure a static DHCP Client ID and ensure your network caches are clean.
Best Practice Fix: Configure DHCP Client ID & Flush Caches
This comprehensive solution addresses underlying causes like corrupted caches and inconsistent DHCP requests, promoting more stable network connections.
-
Configure a DHCP Client ID:
- Go to the Apple menu () > System Settings.
- In the sidebar, click Network.
- Select Wi-Fi from the list.
- Click the Details... button next to your active Wi-Fi connection.
- In the pop-up window, navigate to the TCP/IP tab.
- In the DHCP Client ID field, enter a unique identifier (e.g.,
ConnecMac). This helps the DHCP server consistently identify your Mac. - Click Renew DHCP Lease.
- Click OK to save changes.
-
Flush DNS Cache and Restart Network Processes:
- Open Terminal (Applications > Utilities > Terminal).
- Execute the following commands. These clear DNS records and signal network services to refresh.
Use
sudowith care: These commands require administrator privileges. Ensure you understand their purpose before execution, askillallcan temporarily disrupt network-related services. -
Renew DHCP Lease via Terminal (Optional, but good practice):
- Still in Terminal, execute: This command specifically targets the Wi-Fi interface to re-request DHCP information.
-
Restart Your Mac: While not always strictly necessary, a full restart after these changes can ensure all network configurations are reloaded correctly.
🧩 Technical Context (Visualized)¶
macOS manages its network configuration primarily through the configd daemon, which handles DHCP requests via files like /Library/Preferences/SystemConfiguration/preferences.plist. DNS resolution is managed by mDNSResponder. When the DHCP lease process (requesting or renewing an IP address) fails, often due to server unresponsiveness, corrupted local configuration, or expired leases, the system falls back to a self-assigned IP, leading to a loss of internet access.
graph TD
A[Mac Connects/Wakes] --> B{DHCP Lease Status Check}
B -- Lease Valid --> C[Network Connection OK]
B -- Lease Expired/Invalid --> D[DHCP Request via configd]
D -- "Server Responds (ACK)" --> C
D -- No Response / Rejection --> E[DHCP Timeout/Failure]
E -- Causes --> F[Short Server Lease Times]
E -- Causes --> G[Corrupted preferences.plist/DNS Cache]
E -- Causes --> H[Misconfigured DHCP Client ID]
E -- Result --> I["Self-Assigned IP (169.254.x.x)"]
I -- Leads To --> J[No Internet Access]
J -- "User Action (Renew Lease/Flush Caches)" --> D
✅ Verification¶
After applying the solutions, verify your network connectivity using these Terminal commands:
- Check your IP address: Ensure you have a valid IP (e.g.,
192.168.x.x), not a169.254.x.xself-assigned one. - Test internet connectivity: Ping a reliable public DNS server like Google's. You should see successful replies without packet loss.
- Verify DNS resolvers: Confirm your Mac is using the correct DNS servers provided by your network.
📦 Prerequisites¶
To perform these steps, you will need: * macOS Ventura (13) or later. * Administrator privileges on your Mac. * Access to the Terminal application.