How to Fix ‘Safari Cannot Connect to the Server’ Error on Mac

Attempting to load a webpage in Safari on macOS only to be confronted with a blank window stating “Safari Can’t Connect to the Server. Safari can’t open the page ‘[URL]’ because Safari can’t connect to the server ‘[server]'” prevents internet navigation. When this occurs, other internet-dependent applications (such as Mail or Spotify) might continue functioning normally, or third-party browsers like Chrome may open the page effortlessly, isolating the failure directly to Safari’s network stack. In macOS, Safari utilizes Apple’s native CFNetwork framework and System Configuration proxies. When stale DNS records accumulate in mDNSResponder, misconfigured HTTP proxy toggles intercept web sockets, or local Keychain security tokens fail cryptographic validation, Safari aborts TCP connection attempts. This guide explains how to fix ‘Safari cannot connect to the server’ on Mac.

What Causes “Safari Can’t Connect to the Server”?

Connection failures in Safari originate from DNS resolution stalls, proxy misconfigurations, and cached network tokens:

  • Corrupted Local DNS Cache: Stale IP address mappings residing within the macOS Multicast DNS Responder (mDNSResponder).
  • Accidental Proxy Configuration: Web proxy (HTTP/HTTPS) or SOCKS proxy toggles enabled in macOS Network settings routing traffic into a dead local port.
  • Stale Safari Website Data & Caches: Damaged HTTP/2 session tickets or malformed cookie headers stored in Safari’s local cache partition.
  • Third-Party VPN & Antivirus Network Filters: System network extensions (such as Little Snitch, NordVPN, or Avast) blocking CFNetwork socket handshakes.
  • IPv6 Protocol Routing Timeouts: Safari attempting to query non-routable IPv6 addresses when local internet service providers only support IPv4.

Method 1: Flush macOS DNS Cache and Restart mDNSResponder

Purging the operating system DNS cache clears expired domain records and forces Safari to perform a fresh DNS lookup.

  1. Open Terminal (press Cmd + Space, type Terminal, and press Enter).
  2. Execute the official macOS DNS flush command:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  3. Enter your Mac administrator password when prompted and press Enter.
  4. Restart Safari and attempt to load the webpage again.

Method 2: Disable Unnecessary Network Proxies in macOS Settings

Unintentional proxy settings redirect Safari’s web requests to non-existent local server ports.

  1. Open System Settings from the Apple menu.
  2. Click Wi-Fi (or Network) in the left sidebar.
  3. Click Details… next to your connected active Wi-Fi or Ethernet network.
  4. Select Proxies in the left pane of the details sheet.
  5. Inspect all proxy toggles:
    • Ensure Auto proxy discovery, Automatic proxy configuration, Web proxy (HTTP), and Secure web proxy (HTTPS) are all switched Off.
  6. Click OK to apply changes, then reload Safari.

Method 3: Configure Reliable Public DNS Servers (Cloudflare / Google)

If your default ISP DNS server is experiencing regional downtime, switching to high-speed public Anycast DNS resolves lookup errors.

  1. In System Settings > Wi-Fi > click Details… next to your network.
  2. Select the DNS tab in the left pane.
  3. Under the DNS Servers box, click the plus (+) button.
  4. Add Cloudflare DNS:
    1.1.1.1
    1.0.0.1
  5. Add Google DNS as fallback:
    8.8.8.8
    8.8.4.4
  6. Click OK and test page loading in Safari.

Method 4: Clear Safari Caches and Website Data

Corrupted local cache files can prevent Safari from establishing fresh HTTP/2 or HTTP/3 connections.

  1. In Safari, click Safari in the top menu bar > Settings (or Preferences).
  2. Select the Privacy tab and click Manage Website Data…
  3. Click Remove All and confirm (or search for the specific domain and remove its data).
  4. Next, enable the Develop menu: go to Settings > Advanced > check Show features for web developers.
  5. In the top menu bar, click Develop > Empty Caches.
  6. Quit Safari (Cmd + Q) and relaunch it.

Method 5: Disable IPv6 (If ISP Does Not Support It)

If Safari attempts to resolve IPv6 AAAA records on an IPv4-only network connection, requests hang until timing out.

  1. Open System Settings > Network > click your active connection > Details…
  2. Select TCP/IP in the left pane.
  3. Locate Configure IPv6.
  4. Change the setting from Automatically to Link-local only (or Off).
  5. Click OK and refresh Safari.

Safari Connection Failure Diagnostic Matrix

Error Message / Indicator Probable Root Cause Primary Resolution
“Safari can’t connect to the server” Corrupted mDNSResponder cache or proxy enabled Flush DNS in Terminal; disable all Proxies in Network settings
Error occurs on all websites in Safari only CFNetwork socket deadlock or proxy redirection Disable proxies; empty Safari caches via Develop menu
Page loads in Chrome but fails in Safari Safari strict IPv6 or iCloud Private Relay routing stall Turn off iCloud Private Relay in Apple ID settings; set IPv6 to Link-local
“A server with the specified hostname could not be found” DNS resolution failure (NXDOMAIN) Add 1.1.1.1 and 8.8.8.8 to Network DNS settings

Frequently Asked Questions

Can iCloud Private Relay cause Safari connection errors?

Yes. If you have an active iCloud+ subscription, iCloud Private Relay encrypts Safari traffic and routes it through two separate internet relays. If Apple’s relay partner servers experience network delays, Safari will fail to connect. Navigate to System Settings > Apple Account > iCloud > Private Relay and toggle it Off to test.

Why does Safari say it cannot connect when my Wi-Fi is working?

An active Wi-Fi connection only confirms that your Mac is communicating with your local router. If your router has lost external internet access, or if your local DNS server cannot translate domain names into IP addresses, Safari will display the “Cannot connect to the server” error despite full Wi-Fi signal bars.

Get the best tech tips delivered straight to your inbox.

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