How to Fix A Server with the Specified Hostname Could Not Be Found on Mac

When launching Safari, the Mac App Store, or developer utilities on macOS, receiving the error dialogue A server with the specified hostname could not be found (system error code NSURLErrorCannotFindHost / -1003) cuts off internet connectivity to specific applications while other network tools may still operate. This communication fault occurs when macOS’s low-level CFNetwork architecture fails to resolve remote host names, usually caused by corrupted local DNS resolver tables, orphaned proxy configurations, or stale VPN filter extensions. Resolving this issue involves refreshing your network resolution stack.

Flush macOS DNS Cache and Reset mDNSResponder via Terminal

The macOS multicast DNS daemon caches domain lookups to speed up web requests. If a cached IP address changes or corrupts, applications fail to reach the remote server.

  1. Press Cmd + Space to open Spotlight, type Terminal, and press Enter.
  2. Execute the following combined flush command:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  3. Enter your Mac administrator password when prompted and press Return.
  4. This immediately purges the operating system’s internal name resolution cache and forces macOS to query authoritative DNS nameservers afresh.

Configure Public Anycast DNS Resolvers in Network Settings

If your local internet service provider (ISP) DNS servers are experiencing latency or packet loss, switching to trusted global resolvers eliminates lookup failures.

  1. Click the Apple menu in the top-left corner and select System Settings.
  2. Click Network in the left sidebar and select your active Wi-Fi or Ethernet connection.
  3. Click the Details… button and switch to the DNS tab.
  4. Under the DNS Servers list, click the plus (+) button at the bottom.
  5. Add the primary and secondary Anycast addresses for Cloudflare: 1.1.1.1 and 1.0.0.1 (or Google DNS: 8.8.8.8 and 8.8.4.4).
  6. Click OK to apply changes immediately.

Inspect and Disable Orphaned Network Proxies

Uninstalled security applications, corporate VPNs, or malicious adware often leave lingering proxy pointers in macOS network configuration profiles.

  1. In System Settings > Network, click Details… on your active connection and switch to the Proxies tab.
  2. Inspect the list of protocol proxies (Auto Proxy Discovery, Web Proxy HTTP, Secure Web Proxy HTTPS, SOCKS Proxy).
  3. Ensure all manual proxy toggles are switched Off unless specifically mandated by your corporate network administrator.
  4. Click OK to save changes and eliminate rogue redirection loops.

Renew DHCP Lease to Re-establish Gateway Communication

If your local router assigned an expired or conflicting IP lease to your Mac’s network interface, renewing the lease re-initialises the local subnet gateway.

  • Navigate to System Settings > Network > Details… > TCP/IP tab.
  • Locate the button labelled Renew DHCP Lease and click it.
  • Wait five seconds for the router to assign a fresh IP lease and gateway route, then test your web connection again.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.