How to Flush DNS Cache on macOS to Fix Website Loading Errors

Configurare noua (How To)

Situatie

You are trying to visit a specific website on your Mac, but you encounter connection errors like “Server Not Found” or “404 Not Found”, even though the site works fine on other devices in the same network. This usually happens when your Mac saves an outdated or corrupted Domain Name System (DNS) record in its local cache after a domain migration or network configuration change.

Solutie

Step 1: Open Terminal via Spotlight Search

To interact with the macOS system layer, open the Terminal application. Press Cmd + Space to launch Spotlight Search, type Terminal into the search bar, and press Enter. The operating system instantly finds and highlights the Terminal application.

Step 2: Execute the DNS Cache Flush Command

Once the Terminal window opens, copy and paste the following command into the prompt, then press Enter:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder This command forces macOS to clear its DNS cache records and restarts the system networking daemon (mDNSResponder). The text you paste must be exact.

Step 3: Enter Your Administrator Password

Because the command uses sudo, macOS will prompt you to authenticate: Password:. Type your Mac user account password and press Enter. The visual feedback in Terminal will change to require this input. (Note: The cursor will not move or show characters while typing your password—this is standard macOS security behavior).

Step 4: Restart Your Web Browser and Clear Browser History

Once the command finishes (Terminal returns to a standard prompt), close and reopen your primary web browser (e.g., Safari or Chrome). In Safari, click Safari in the top menu bar, select Clear History…, choose All History, and click Clear History. This ensures that no stale web sockets or browser-level caches remain active.

Tip solutie

Permanent

Voteaza

(3 din 5 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?