What a DNS Error on macOS Means
A DNS (Domain Name System) error on macOS means your computer cannot convert a domain name (like google.com) into its corresponding IP address. As a result, websites fail to load, even though your network connection may be active. Typical browser messages include: "Server IP address could not be found," "DNS_PROBE_FINISHED_NXDOMAIN," or "Server not found."
Common Causes
- Outdated or corrupted DNS cache — macOS stores temporary records of domains that can become invalid.
- Incorrect DNS server settings — manually configured unreachable servers or an ISP providing non-functional addresses.
- ISP DNS server issues — a temporary outage on the internet provider's side.
- Blocking in the hosts file — entries in the system
/etc/hostsfile may redirect or block specific domains. - Conflict with antivirus or firewall — some security software can interfere with DNS queries.
- Corruption of macOS network configuration files — malfunctions in network adapter configuration files.
Method 1: Restart Your Mac and Network Hardware
Often, the problem is resolved by simply refreshing the connection.
- Shut down your Mac via the Apple menu → "Log Out" → "Log Out" (or hold the power button).
- Unplug your router/modem power for 30 seconds, then plug it back in.
- Wait for the router to fully boot (stabilize blinking lights).
- Turn on your Mac and check if websites load.
💡 Tip: If the issue occurs only on Wi-Fi, try connecting via Ethernet to rule out wireless connection problems.
Method 2: Flush DNS Cache via Terminal
The DNS cache may contain outdated records. Clearing it forces macOS to request fresh information.
- Open Terminal (Applications → Utilities → Terminal).
- Enter the following commands one by one, pressing Enter after each:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
- When prompted, enter your administrator password (characters won't be displayed — this is normal).
- Close Terminal and try opening a website in your browser.
Method 3: Switch to Public DNS Servers
Using reliable public DNS servers (Google, Cloudflare) often resolves the issue.
- Open System Settings → Network.
- Select your active connection (Wi-Fi or Ethernet) and click Details….
- Go to the DNS tab.
- Click + and add the servers:
8.8.8.8(Google)1.1.1.1(Cloudflare)
- Remove all old DNS servers from the list (select and click -).
- Click OK, then Apply.
- Test website accessibility.
Method 4: Check and Edit the Hosts File
The /etc/hosts file may contain entries blocking specific domains.
- In Terminal, run:
sudo nano /etc/hosts
- Enter your administrator password.
- Check lines where IP addresses and domains are listed (e.g.,
127.0.0.1 example.com). If a needed site is blocked, delete the line (Ctrl+K) or comment it out by placing#at the start. - Save changes: Ctrl+O, Enter.
- Exit: Ctrl+X.
- Flush the DNS cache as described in Method 2.
Method 5: Reset macOS Network Settings
If previous steps didn't help, perform a full reset of network configurations.
- In Terminal, run these commands to remove configuration files:
sudo rm /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist
sudo rm /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
sudo rm /Library/Preferences/SystemConfiguration/com.apple.network.eppc.plist
- Restart your Mac.
- After booting, the system will create new files. Reconfigure your network (enter Wi-Fi password if needed).
Prevention
- Use stable DNS servers — configure public DNS (8.8.8.8, 1.1.1.1) on your router or Mac.
- Update macOS — newer system versions often include fixes for network components.
- Avoid suspicious software — some network "accelerator" utilities can break DNS.
- Flush cache regularly if issues recur — run the commands from Method 2 monthly.
- Check the hosts file after installing programs that may modify system settings (e.g., ad-blocking utilities).