Fix DNS Not Responding on Mac
When DNS stops working on macOS, websites fail to load even though your internet connection is fine. This guide covers eight troubleshooting steps from basic cache flushes to diagnosing iCloud Private Relay conflicts.
Common causes of DNS failure on macOS
- Stale DNS cache — mDNSResponder caches lookups that can become corrupt or outdated.
- iCloud Private Relay issues — Apple's relay service can intercept and break DNS when it malfunctions.
- VPN DNS override — VPN clients change DNS settings and may not restore them after disconnecting.
- Network profile corruption — Switching between networks (home, office, coffee shop) can leave stale DNS entries.
- macOS update side effects — System updates occasionally reset or alter DNS configuration.
Step 1 — Test basic connectivity
Open Terminal (Applications > Utilities > Terminal) and run:
ping -c 4 1.1.1.1
If you see replies with round-trip times, your internet connection is working and DNS is the problem. If ping fails, check your Wi-Fi or Ethernet connection, restart your router, and try again before continuing.
Step 2 — Flush the DNS cache
macOS caches DNS lookups in mDNSResponder. Stale or corrupt entries are the most common cause of DNS failures. Clear the cache:
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder
Enter your password when prompted. There is no confirmation message — the command succeeds silently.
Then test:
nslookup example.com
If you get an IP address, the cache flush fixed the issue. If nslookup times out, continue to the next step.
Step 3 — Check DNS settings in System Settings
macOS Ventura and later:
- Open System Settings.
- Click Network in the sidebar.
- Click your active connection (Wi-Fi or Ethernet).
- Click Details, then select the DNS tab.
Check that the DNS servers listed are valid and reachable. Greyed-out entries come from DHCP (your router). Manually added entries appear in bold.
Step 4 — Remove stale DNS entries
If you see DNS server addresses from old networks, a previous VPN, or an old ISP, remove them. In the DNS tab:
- Select the stale entry.
- Click the minus (−) button to remove it.
- Click OK.
Stale entries are especially common on laptops that connect to multiple networks. macOS can accumulate DNS entries from every network you have joined.
Step 5 — Switch to public DNS servers
Your ISP's DNS servers may be down or slow. Adding a public resolver often fixes DNS immediately:
- In the DNS tab, click the plus (+) button.
- Add
1.1.1.1(Cloudflare) and8.8.8.8(Google). - Click OK, then Apply.
Terminal alternative:
sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 8.8.8.8
For a detailed walkthrough, see our macOS DNS setup guide.
Step 6 — Reset network configuration
If individual fixes have not worked, reset the network profile entirely:
- Open System Settings > Network.
- Select your connection and click the minus (−) button to remove it.
- Click the plus (+) button to add it back.
- Reconnect to your network.
This recreates the network configuration from scratch, clearing any accumulated corruption.
Step 7 — Check /etc/resolv.conf
Run in Terminal:
cat /etc/resolv.conf
You should see nameserver entries pointing to your configured DNS servers. If the file contains only 127.0.0.1, that means mDNSResponder is handling resolution locally (normal behavior). If it contains an unreachable IP, that IP is the source of your DNS failure.
Note: Do not edit this file directly on macOS. It is managed by mDNSResponder and your changes will be overwritten. Use System Settings or networksetup commands instead.
Step 8 — Disable iCloud Private Relay
iCloud Private Relay (available with iCloud+) routes your DNS queries through Apple's relay infrastructure. When this service has issues, DNS breaks in ways that are hard to diagnose.
- Open System Settings > Apple ID > iCloud.
- Click Private Relay.
- Toggle it off.
- Test your DNS. If it works now, Private Relay was the culprit.
You can re-enable Private Relay later — the issue may be a temporary Apple service disruption.
Test your DNS configuration
After resolving your DNS issue, verify your setup is secure and fast:
- DNS Privacy Check — Audit your DNS for leaks, DNSSEC validation, and encrypted transport.
- DNS Gaming Benchmark — Find the lowest-latency DNS server for your Mac.
- Browse all public DNS servers — Live-tested directory of reliable resolvers.
Frequently asked questions
Why did DNS break after a macOS update?
macOS updates can reset DNS configurations, restart mDNSResponder with different settings, or introduce bugs in the DNS resolution stack. After updating, flush the cache and verify your DNS settings are still in place.
Does iCloud Private Relay affect DNS?
Yes. Private Relay routes your DNS queries through Apple relay servers. If the relay service has an outage or your iCloud+ subscription lapses, DNS resolution can fail. Disabling Private Relay reverts to your configured DNS servers.
How do I set DNS via Terminal on macOS?
Run: sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 8.8.8.8 to set DNS for your Wi-Fi interface. Replace Wi-Fi with the exact interface name shown by networksetup -listallnetworkservices.
Can a VPN cause DNS issues on macOS?
Absolutely. VPN clients override DNS settings to route queries through the VPN tunnel. If the VPN disconnects improperly, macOS can be left pointing at an unreachable DNS server. Disconnect the VPN, flush DNS, and check your DNS settings.