macOS NXDOMAINMedium

DNS Error on macOS: Causes and Solutions

The article explains what causes DNS issues on macOS and provides several ways to fix them, from basic to advanced.

Updated at February 16, 2026
5-15 min
Easy
FixPedia Team
Применимо к:macOS Sonoma 14+macOS Ventura 13+macOS Monterey 12+

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

  1. Outdated or corrupted DNS cache — macOS stores temporary records of domains that can become invalid.
  2. Incorrect DNS server settings — manually configured unreachable servers or an ISP providing non-functional addresses.
  3. ISP DNS server issues — a temporary outage on the internet provider's side.
  4. Blocking in the hosts file — entries in the system /etc/hosts file may redirect or block specific domains.
  5. Conflict with antivirus or firewall — some security software can interfere with DNS queries.
  6. 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.

  1. Shut down your Mac via the Apple menu → "Log Out" → "Log Out" (or hold the power button).
  2. Unplug your router/modem power for 30 seconds, then plug it back in.
  3. Wait for the router to fully boot (stabilize blinking lights).
  4. 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.

  1. Open Terminal (Applications → Utilities → Terminal).
  2. Enter the following commands one by one, pressing Enter after each:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
  1. When prompted, enter your administrator password (characters won't be displayed — this is normal).
  2. 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.

  1. Open System SettingsNetwork.
  2. Select your active connection (Wi-Fi or Ethernet) and click Details….
  3. Go to the DNS tab.
  4. Click + and add the servers:
    • 8.8.8.8 (Google)
    • 1.1.1.1 (Cloudflare)
  5. Remove all old DNS servers from the list (select and click -).
  6. Click OK, then Apply.
  7. Test website accessibility.

Method 4: Check and Edit the Hosts File

The /etc/hosts file may contain entries blocking specific domains.

  1. In Terminal, run:
sudo nano /etc/hosts
  1. Enter your administrator password.
  2. 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.
  3. Save changes: Ctrl+O, Enter.
  4. Exit: Ctrl+X.
  5. 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.

  1. 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
  1. Restart your Mac.
  2. 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).

F.A.Q.

How to check if the problem is specifically DNS on Mac?
Why are only some sites not loading while the internet in general works?
Do I need to change DNS servers in the router settings or on the Mac itself?
What to do if none of the methods help and the internet works in other networks?

Hints

Restart your Mac and network equipment
Flush DNS cache via Terminal
Change DNS servers in network settings
Check the hosts file for blocks
Reset macOS network settings
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community