Mac Wi-Fi Connected but No Internet: How to Fix DNS Settings
When your Mac shows a healthy Wi-Fi connection but fails to access the internet, the culprit is frequently an issue with DNS (Domain Name System) resolution. This guide provides a direct, actionable approach to diagnose and resolve such connectivity problems by focusing on macOS DNS configurations.
🚨 Symptoms & Diagnosis¶
A common set of indicators points to DNS-related issues when your Mac's Wi-Fi is connected but lacks internet access:
- No internet connection: Browsers display "This site can't be reached" or similar errors, despite the Wi-Fi icon showing full bars and being connected to an access point.
- DNS server not responding: Network diagnostics might specifically highlight a failure to connect to DNS servers.
nslookupfailure: Commands run in Terminal fail to resolve hostnames.- Log entries: System logs may show errors related to DNS resolution.
- Non-zero
nslookupexit code:
Root Cause: The primary culprits often include corrupted DNS caches within macOS services (
mDNSResponder, System Configuration daemon), incorrectly configured manual DNS servers in Network preferences, or stale network interface states (e.g.,en0,en1) potentially compounded by IPv6 conflicts.
🛠️ Solutions¶
Immediate Mitigation: Flush DNS Cache & Restart mDNSResponder¶
This quick fix purges any stale or corrupted DNS entries from your Mac's local cache and restarts the core DNS resolution service. This often resolves transient DNS issues without requiring deeper configuration changes.
- Open the Terminal application (Finder > Applications > Utilities > Terminal).
- Execute the following command to send a
HUPsignal tomDNSResponder, effectively flushing its cache and restarting the service: You will be prompted to enter your administrator password. - Test basic network connectivity and DNS resolution with
pingcommands:If theping -c 4 8.8.8.8 # Pings Google's DNS server directly by IP (bypasses DNS resolution) ping -c 4 google.com # Tests DNS resolution and connectivity to a hostnameping google.comcommand now receives replies, the issue was likely a corrupted DNS cache.
Best Practice Fix: Reset DNS Configuration & Interface State¶
This comprehensive approach resets your Mac's DNS settings to automatic, cycles the network interface, and addresses potential IPv6 conflicts, ensuring a clean slate for network communication.
- Open Terminal.
- Identify your Wi-Fi network service name. Typically, this is "Wi-Fi". Look for the entry that corresponds to your active Wi-Fi connection.
- Reset DNS servers to automatic (DHCP) for your Wi-Fi service. This ensures your Mac requests DNS server addresses from your router or network's DHCP server, rather than using potentially outdated manual entries.
(Replace
Wi-Fiwith the exact name found in step 2 if different). - Manually remove any remaining manual DNS servers via System Settings:
- Go to System Settings > Network.
- Select Wi-Fi from the left-hand sidebar.
- Click the Details... button next to your connected Wi-Fi network.
- Navigate to the DNS tab.
- If you see any IP addresses under "DNS Servers", select them and click the - (minus) button to remove them. Ensure the list is empty or shows only
(Grayed out: 192.168.1.1, etc.)indicating DHCP. - Click OK to apply changes.
- Cycle the Wi-Fi network interface. This can resolve stale interface states.
en0is commonly the Wi-Fi interface, but it might been1or another on some systems. Ifen0doesn't work, verify your Wi-Fi interface name usingifconfigornetworksetup -listallhardwareportsand replaceen0accordingly. - Toggle IPv6 configuration (optional, if issues persist): IPv6 misconfigurations can sometimes interfere with DNS resolution.
🧩 Technical Context (Visualized)¶
macOS manages network configuration and DNS resolution through a sophisticated subsystem involving mDNSResponder (for multicast DNS and local DNS caching), the System Configuration framework, and utilities like scutil and networksetup. When an application requests to resolve a hostname, the request typically flows through the macOS DNS resolver, which consults its local cache (mDNSResponder) and then the System Configuration framework to determine which external DNS servers to query based on current network settings.
graph TD
A[User Application Request] -- "> B(macOS DNS Resolver)
B" --> C{DNS Cache & mDNSResponder}
C -->|Cache Hit| D[Resolved IP Address]
C -->|Cache Miss| E(System Configuration Framework)
E -- "> F(Configured DNS Servers <br/>(via networksetup / System Settings))
F" --> G["External DNS Server <br/>(e.g., Router, ISP, Public DNS)"]
G --> H[Authoritative DNS for Domain]
H --> D
D --> B
B --> A
✅ Verification¶
After implementing the solutions, use these commands in Terminal to confirm proper DNS resolution and network connectivity:
- Verify DNS resolution for a specific domain:
Expected output includes server and address information for
google.com. - Display current DNS server configuration as seen by
scutil: This will show the active DNS configurations, including any specified name servers. - Test end-to-end connectivity to a public hostname: Successful pings indicate both DNS resolution and network path are operational.
- Query a specific DNS server directly to bypass local resolver (for advanced diagnostics):
This confirms if
google.comis resolvable by a known good public DNS server (Google's 8.8.8.8).
📦 Prerequisites¶
To perform these troubleshooting steps, you will need:
* macOS Ventura+ (version 13 or newer): While commands are generally similar, System Settings UI paths might vary on older macOS versions.
* Administrator privileges: Commands requiring sudo necessitate an administrator account password.
* Terminal application: Located in /Applications/Utilities/.