Skip to content
macOS WiFi Connectivity 📅 2026-02-06

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.
  • nslookup failure: Commands run in Terminal fail to resolve hostnames.
    nslookup: can't resolve hostname
    
  • Log entries: System logs may show errors related to DNS resolution.
    /var/log/system.log - 'mDNSResponder[1234]: DNSServiceGetAddrInfo' failed
    
  • Non-zero nslookup exit code:
    Exit code: nslookup non-zero (e.g., 1)
    

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.

  1. Open the Terminal application (Finder > Applications > Utilities > Terminal).
  2. Execute the following command to send a HUP signal to mDNSResponder, effectively flushing its cache and restarting the service:
    sudo killall -HUP mDNSResponder
    
    You will be prompted to enter your administrator password.
  3. Test basic network connectivity and DNS resolution with ping commands:
    ping -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 hostname
    
    If the ping google.com command 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.

  1. Open Terminal.
  2. Identify your Wi-Fi network service name. Typically, this is "Wi-Fi".
    networksetup -listallnetworkservices
    
    Look for the entry that corresponds to your active Wi-Fi connection.
  3. 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.
    networksetup -setdnsservers Wi-Fi Empty
    
    (Replace Wi-Fi with the exact name found in step 2 if different).
  4. 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.
  5. Cycle the Wi-Fi network interface. This can resolve stale interface states. en0 is commonly the Wi-Fi interface, but it might be en1 or another on some systems.
    sudo ifconfig en0 down # Deactivates the interface
    sudo ifconfig en0 up   # Reactivates the interface
    
    If en0 doesn't work, verify your Wi-Fi interface name using ifconfig or networksetup -listallhardwareports and replace en0 accordingly.
  6. Toggle IPv6 configuration (optional, if issues persist): IPv6 misconfigurations can sometimes interfere with DNS resolution.
    networksetup -setv6off Wi-Fi # Disables IPv6 for the Wi-Fi service
    networksetup -setv6on Wi-Fi  # Re-enables IPv6 for the Wi-Fi service (or leave off if you suspect IPv6 issues)
    

🧩 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:
    nslookup google.com
    
    Expected output includes server and address information for google.com.
  • Display current DNS server configuration as seen by scutil:
    scutil --dns
    
    This will show the active DNS configurations, including any specified name servers.
  • Test end-to-end connectivity to a public hostname:
    ping -c 4 google.com
    
    Successful pings indicate both DNS resolution and network path are operational.
  • Query a specific DNS server directly to bypass local resolver (for advanced diagnostics):
    dig @8.8.8.8 google.com
    
    This confirms if google.com is 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/.