While browsing on macOS, Safari may abruptly halt loading and display the warning: “Safari cannot open the page because the network connection was lost” (NSPOSIXErrorDomain:57 or kCFErrorDomainCFNetwork:303). Even when other networked utilities or third-party browsers appear to communicate normally, Safari’s strict transport security checks and socket pooling can fail on volatile Wi-Fi links or stale DNS records.
Flush DNS Resolver Cache via macOS Terminal
Corrupted local domain name resolver caches often hand Safari outdated socket addresses, resulting in dropped TCP handshake acknowledgements.
- Open the Terminal application from Applications > Utilities or via Spotlight (Cmd + Space).
- Execute the following DNS cache clearing command:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - Enter your administrator account password when prompted and press Return.
- Restart Safari and refresh the failing destination webpage.
Disable iCloud Private Relay and Custom Web Proxies
Apple’s iCloud Private Relay routes Safari web traffic through two encrypted internet relays. If relay nodes experience transit interruptions, Safari aborts active connections immediately.
- Open System Settings > [Your Apple Account] > iCloud.
- Locate Private Relay and temporarily toggle the feature to Off.
- Navigate to System Settings > Network > Wi-Fi > Details > Proxies.
- Verify that Auto Proxy Discovery and Automatic Proxy Configuration are unchecked unless specifically required by an enterprise network.
Remove Stale Website Data and Content Blockers
Damaged HTTP keep-alive sockets stored in Safari’s local session cache can trigger immediate socket dropouts upon page reloads.
- In Safari, click Safari > Settings (or press Cmd + ,).
- Select the Privacy tab and click Manage Website Data.
- Click Remove All to clear stored cookies and local storage tokens.
- Navigate to the Extensions tab and untick third-party content blockers or ad-filtering plugins to rule out aggressive socket filtering.