Flushing the DNS cache on a Mac clears the stored records that map domain names to IP addresses. This is useful when websites load slowly, show errors, or you’ve changed your DNS settings and want the new ones to take effect immediately. The process is quick and safe, and you don’t need any special tools—just your Mac’s Terminal app.
What You’ll Need
- Your Mac’s administrator password (you’ll need it to run the flush command with sudo).
- Access to the Terminal app, located in /Applications/Utilities/.
Step-by-Step
- Open Terminal. Go to Finder > Applications > Utilities, then double-click Terminal. You can also use Spotlight (Cmd+Space) and type “Terminal” to open it.
- Identify your macOS version. Click the Apple menu (top-left) and select About This Mac. Note the version number, such as macOS Sonoma 14.5 or macOS Ventura 13.6.
- Run the appropriate command. In the Terminal window, type the command that matches your macOS version, then press Return.
- For macOS Ventura (13) and later: Type
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderand press Return. You’ll be prompted for your password—type it (it won’t show as you type) and press Return again. - For macOS Monterey (12) and earlier: Type
sudo killall -HUP mDNSResponderand press Return. Enter your password when prompted. - Confirm success. After the command runs, you’ll see a new prompt line (e.g.,
yourname@MacBook). This means the cache has been flushed. You can close Terminal. - Test your connection. Open Safari or your preferred browser and try loading the website that was giving you trouble. If the issue persists, restart your Mac to ensure all DNS processes are fully reset.
Common Mistakes
- Using the wrong command for your macOS version. Running an outdated command (like the one for macOS 10.10) on newer versions can fail or not flush the cache properly. Always check your version first.
- Forgetting to use
sudo. The flush commands require administrator privileges. Withoutsudo, you’ll see a “permission denied” error. - Typing the command incorrectly. Commands are case-sensitive and must be exact. A missing space or a typo can cause the command to fail or do nothing.
- Not entering your password after
sudo. You’ll be prompted for your login password. If you don’t type it, the command won’t execute.
Tips
- Use the combined command for macOS 13+. The
dscacheutil -flushcache; sudo killall -HUP mDNSRespondercommand flushes both the system cache and the mDNSResponder cache in one go. - Check your DNS settings first. If you’re flushing because of a DNS issue, verify that your DNS servers are set correctly in System Settings > Network > Your Connection > Details > DNS.
- Flush after changing DNS servers. If you switch to a public DNS like Google (8.8.8.8) or Cloudflare (1.1.1.1), flushing ensures the new servers are used immediately.
- Restart your router if needed. Sometimes the cache is on your router, not your Mac. If flushing doesn’t help, try restarting your router.
Troubleshooting
Command not found: If you see “command not found,” you likely typed the command incorrectly. Double-check the spelling and spaces, then try again.
Permission denied: This means you didn’t use sudo or your password was incorrect. Run the command with sudo and make sure you enter the correct admin password.
No output after running the command: This is normal. The flush commands are silent when they succeed. You’ll just see a new prompt line.
Websites still don’t load after flushing: The problem may not be your DNS cache. Try clearing your browser cache, disabling browser extensions, or using a different network (e.g., your phone’s hotspot) to isolate the issue.
You’re on macOS 10.10 or older: The command for those versions is sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder—but note that macOS 10.10 is very old and unsupported. Consider updating your Mac if possible.
Frequently Asked Questions
Q: How often should I flush my DNS cache?
A: Only when you’re experiencing DNS-related issues, such as websites not loading or showing wrong content. Flushing regularly is unnecessary and can slow down your browsing slightly as the cache rebuilds.
Q: Will flushing DNS cache delete my bookmarks or history?
A: No. Flushing the DNS cache only removes temporary IP address records. Your browser history, bookmarks, and other personal data remain untouched.
Q: What does DNS cache do?
A: It stores the IP addresses of websites you’ve visited, so your Mac doesn’t have to ask a DNS server every time. This speeds up browsing, but stale entries can cause problems.
Q: Can I flush DNS cache without using Terminal?
A: On current macOS versions, Terminal is the standard method. There’s no built-in GUI button for it, but you can use third-party apps that automate the command.
Q: Why do I need to enter my password?
A: The flush commands modify system-level network settings, which require administrator privileges. Your password confirms you have permission to make those changes.
Q: What if I’m not the admin of my Mac?
A: You’ll need to ask the admin to run the command for you, or to give you admin access temporarily. Without admin rights, you can’t flush the DNS cache.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix Device Manager Not Opening in Windows 11
- How to Pause Snapchat Location
- System Restore Points Missing in Windows? Fixes
- Loop Nature Ambience Videos with FFmpeg on Ubuntu
- Install League of Legends on Linux: Full Guide
- Fix Error 0x80070001: Causes & Solutions