What Does the "DNS lookup failed" Error Mean
The "DNS lookup failed" error in macOS indicates that the operating system was unable to convert a domain name (e.g., fixpedia.ru) into its corresponding IP address. As a result, browsers and applications cannot locate servers on the internet, even though the network connection (Wi-Fi or Ethernet) may appear active. The error typically appears in browsers (Safari, Chrome), email clients, or when attempting to update software.
Common Causes
- Network connection or router issues. A temporary outage on the provider's side or within your home router.
- Incorrect or unresponsive DNS servers. The DNS servers configured in your system (often provided by your ISP) are not responding or are returning errors.
- Corrupted local DNS cache. The system cache (
mDNSResponder) contains outdated or erroneous records. - Incorrect entries in the
hostsfile. The/etc/hostsfile may contain lines redirecting domains to incorrect IP addresses (e.g.,127.0.0.1). - Conflict with a firewall or antivirus. Security software may be blocking outgoing DNS requests (port 53).
- Problems with VPN or proxy settings. Misconfiguration can intercept or disrupt DNS queries.
Solutions
Solution 1: Restart Network Hardware and Services
Start with the simplest actions, which resolve most temporary glitches.
- Toggle Wi-Fi. Click the Wi-Fi icon in the macOS menu bar and turn it off. Wait 10 seconds and turn it back on.
- Restart your router/modem. Unplug the device from power for 30 seconds, then plug it back in. Wait for it to fully boot (all indicators stabilize).
- Restart the network interface via Terminal. This is a "deeper" reboot than simply toggling Wi-Fi. First, identify your interface name (usually
en0for Wi-Fi oren1for Ethernet) by runningifconfig | grep status. Then execute:
(Replacesudo ifconfig en0 down sudo ifconfig en0 upen0with your actual interface name).
💡 Tip: If you use Ethernet, try switching temporarily to Wi-Fi (or vice versa) to determine if the problem lies with the hardware or the specific interface's configuration.
Solution 2: Flush the macOS DNS Cache
The local DNS cache may contain outdated records causing errors. Flushing it is done via Terminal.
- Open Terminal (Finder → Utilities → Terminal).
- Enter the following command and press Enter:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - Enter your administrator password (characters will not be displayed — this is normal).
- After the command completes, try accessing the website again in your browser.
⚠️ Important: This command works for macOS 10.10 (Yosemite) and later. For older systems, use
sudo discoveryutil mdnsflushcache.
Solution 3: Check and Edit the Hosts File
The /etc/hosts file allows manual mapping of domain names to IP addresses. If it contains erroneous entries (e.g., ad-blocking rules), it will cause DNS failures.
- In Terminal, open the file for editing with superuser privileges:
sudo nano /etc/hosts - Scroll through the file and look for lines containing known domains (e.g.,
google.com,apple.com,facebook.com) that are redirected to127.0.0.1,0.0.0.0, or other local addresses. - Add a
#symbol at the beginning of each such line to comment it out, or delete the line entirely. - Press
Ctrl + Oto save, thenEnter. PressCtrl + Xto exit nano. - Flush the DNS cache (as in Solution 2) and test your internet connection.
Solution 4: Configure Public DNS Servers (Cloudflare, Google)
Often, the problem lies with your internet provider's DNS servers. Switching to reliable public servers 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 following addresses (choose one set):- Cloudflare:
1.1.1.1and1.0.0.1 - Google:
8.8.8.8and8.8.4.4
- Cloudflare:
- Remove all old DNS servers from the list by selecting them and clicking
-. - Click OK, then Apply.
- Test your internet access. If the issue was with your ISP's DNS, it should now be resolved.
Solution 5: Check for Conflicts with VPN, Firewall, and in Safe Mode
If the previous steps didn't help, the problem may be with third-party software.
- Temporarily disable your VPN (if used) and any third-party firewalls/antivirus software (Little Snitch, McAfee, Kaspersky, etc.). Check if the internet works.
- Boot into Safe Mode. This loads macOS with only essential system extensions, disabling third-party ones. Instructions:
- Restart your Mac.
- Immediately after restart, hold the
Shiftkey (⇧) until you see the login window. - Log in. If the internet works in Safe Mode, the problem is with some installed software (a VPN daemon, ad blocker, optimization utility).
- Check proxy settings. In System Settings → Network → Details → Proxies, ensure all checkboxes are unchecked unless you are using a corporate proxy.
Solution 6: Update macOS and Reset Network Settings
If the problem appeared after a system update or has persisted for a long time:
- Install macOS updates. Go to System Settings → General → Software Update. Install all available updates, especially those related to "networking" or "security".
- Reset network settings. This is a more drastic step that will delete saved Wi-Fi networks, VPN configurations, etc.
- In System Settings → Network, select Wi-Fi.
- Click Remove at the bottom of the preferred networks list.
- For a full reset, you can use Terminal:
Restart your Mac after this. The system will recreate these files with default settings. You will need to reconnect to Wi-Fi networks.sudo rm /Library/Preferences/SystemConfiguration/com.apple.network.eppc.plist sudo rm /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist sudo rm /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist sudo rm /Library/Preferences/SystemConfiguration/com.apple.wifi.message-tracer.plist sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist sudo rm /Library/Preferences/SystemConfiguration/preferences.plist
Prevention
- Use stable public DNS servers (Cloudflare, Google) if your ISP's DNS frequently fails.
- Avoid installing third-party "network optimizers" and questionable utilities that may modify system files or settings.
- Keep macOS regularly updated — updates often contain fixes for the network stack.
- Do not edit the
/etc/hostsfile without fully understanding what you are doing. If you use hosts files for ad blocking, use reputable lists and review them periodically. - When using a VPN, choose reliable providers that handle DNS correctly (support their own DNS or DoH/DoT).