Error Codes Wiki

Mac DNS Lookup Failed — Cannot Resolve Hostname Troubleshooting

Warningnetwork

Overview

Fix Mac DNS lookup failures causing 'server not found', 'DNS lookup failed', and inability to load websites while other network services work.

Key Details

  • macOS uses mDNSResponder for DNS resolution, which can crash or become corrupted
  • DNS issues on Mac can coexist with working IP-level connectivity (ping by IP works but names fail)
  • VPN software frequently modifies DNS settings and may not restore them properly
  • macOS stores DNS settings per-network interface, and wrong settings can persist across networks
  • /etc/resolv.conf on Mac is auto-generated — manual edits are overwritten

Common Causes

  • mDNSResponder service crashed or hung
  • DNS servers configured in network settings are unreachable
  • VPN modified DNS settings and did not restore them after disconnecting
  • Wi-Fi network providing broken DNS server via DHCP
  • macOS DNS cache corrupted with stale or incorrect entries

Steps

  1. 1Flush DNS cache: sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder
  2. 2Check DNS settings: System Settings > Wi-Fi > Details > DNS — ensure valid servers listed
  3. 3Set manual DNS: add 8.8.8.8 and 1.1.1.1 in DNS settings for your network
  4. 4Test resolution: nslookup google.com in Terminal — if it fails, DNS is the issue
  5. 5Restart mDNSResponder: sudo killall mDNSResponder

Tags

macdnslookup-failedmdnsrespondernetwork

More in Network

Frequently Asked Questions

Your network connection works but DNS resolution is broken. DNS translates domain names to IPs. Set manual DNS servers to fix.