If you’re troubleshooting website loading errors, seeing outdated content, or dealing with connection issues on your Mac running Mojave, flushing the DNS cache can often resolve the problem. This guide walks you through the exact Terminal command for macOS Mojave (10.14) and explains what to do if the standard command doesn’t work.
What You’ll Need
- Your Mac running macOS Mojave (10.14)
- Administrator (admin) account access – you’ll need to enter your password
- Terminal app – found in Applications > Utilities
Step-by-Step
- Open Terminal. Go to Finder > Applications > Utilities and double-click Terminal. You can also press Command (⌘) + Space to open Spotlight, type “Terminal,” and press Return.
- Enter the flush command. Type the following command exactly (note the capital K in
-killcache):sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - Press Return. Terminal will ask for your password. Type your admin password and press Return. Note: characters won’t appear as you type – that’s normal.
- Wait for the prompt to return. If the command succeeds, you’ll see a new line with your username and computer name (e.g.,
yourname@yourmac:~$). No success message is normal. - Close Terminal. You can now quit Terminal. Your DNS cache has been flushed.
Common Mistakes
- Using the wrong command. Some guides suggest
killall -HUP mDNSResponderalone, but on Mojave you need both parts (dscacheutil and killall) to fully clear the cache. - Typing the command with a lowercase “k” in
-killcache. The option is case-sensitive – it must be-killcache(lowercase “k” after the hyphen, but the word “killcache” is all lowercase). Actually, the correct flag is-killcache(all lowercase). - Forgetting
sudo. Withoutsudo, you’ll get a “permission denied” error. The command requires administrator privileges. - Closing Terminal before the command finishes. Wait until the prompt returns – if you close it early, the command may not complete.
Tips
- Use the command as a single line. The semicolon (
;) between the two commands runs them sequentially. If you run them separately, you might miss the second one. - Restart your browser after flushing. Some browsers keep their own DNS cache. Quit and reopen Safari, Chrome, or Firefox to ensure they pick up the new DNS settings.
- Check your network connection first. If you’re flushing because of a specific website issue, try loading the site in a private/incognito window first – that can rule out browser cache.
- Consider resetting your router. If flushing doesn’t help, your router may have its own DNS cache. Power-cycle it (unplug for 30 seconds, then plug back in) to clear it.
Troubleshooting
“Operation not permitted” error. This usually means you didn’t use sudo or your account isn’t an admin. Ensure you’re logged in as an admin user and run the command with sudo.
“command not found” error. If you see this, you may have mistyped the command. Copy and paste the exact line: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
Password prompt not appearing. If Terminal doesn’t ask for a password, you might already be running as root (unlikely) or the command was executed without sudo. Press Control + C to cancel and try again with sudo.
Still seeing old DNS after flushing. Some applications (like Chrome) have their own DNS cache. Restart the app or your Mac. Also, your ISP’s DNS servers may cache the old record – wait a few minutes or try a different DNS server (like 8.8.8.8) to test.
Terminal says “No matching processes were found.” This can happen if the mDNSResponder process isn’t running under that name. On Mojave, it should be there. If not, try restarting your Mac – that will also clear the DNS cache.
Frequently Asked Questions
Do I need to flush DNS regularly?
No. Flushing is only needed when you’re troubleshooting DNS-related issues like website errors or outdated IP addresses. Doing it regularly won’t improve performance.
Will flushing DNS slow down my internet?
Temporarily, yes. Your Mac will re-query DNS servers for every domain, which can make the first visits to sites slightly slower. But after a few minutes, the cache rebuilds and speeds return to normal.
Does this command work on newer macOS versions?
On Catalina (10.15) and later, the command is the same. On older versions like High Sierra (10.13), you can use the same command as well. For very old versions (10.10 or earlier), the command was different.
What does killall -HUP mDNSResponder do?
It sends a “hang up” signal to the mDNSResponder process, which manages DNS and Bonjour services. This forces it to restart and reload its cache.
Can I flush DNS without using Terminal?
There’s no built-in GUI option in Mojave. You could restart your Mac, which clears the DNS cache, but that’s less targeted. Third-party apps exist, but the Terminal command is the official method.
Why do I need to enter my password?
The command modifies system-level settings, so macOS requires administrator privileges. This is a security measure to prevent unauthorized changes.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Kick an Uma Codes? Meaning & Use
- Google Forms as Expense Tracker: Step-by-Step
- Smart Lock Modules Worth Buying Early
- Wi-Fi Name Exposes More Info Than You Think?
- GBP to INR Business Payments: Bank vs Fintech vs FX Broker1,049,725.00 INR
- Evaluate Claude for Enterprise Workloads: Checklist