
How to Clear DNS Cache on Mac (Step by Step Guide)
You try to open a website, but it doesn’t load correctly, or it shows an outdated version. This often happens because your Mac has stored old or incorrect website data. The good news is that you can easily fix this by clearing your DNS cache.
What is DNS Cache?
When you visit a website, your Mac stores some hidden information to help that site load faster the next time. This saved information is called the DNS cache.
However, this cache can sometimes become:
- Outdated
- Incorrect
- Corrupted
Which may cause:
- Websites not loading properly
- Slow or broken internet experience on specific sites
- Security or connection errors
Clearing (or flushing) the DNS cache tells your Mac: “Forget the old data and get the latest one.”
When Should You Clear the DNS Cache?
Clear the DNS cache if:
- A website is not loading, but other sites work fine
- You recently updated your website’s DNS or hosting
- You see errors like “Site can’t be reached” or “DNS not found”
- You made changes to your Wi-Fi or network settings
How to Clear DNS Cache on Mac (Works for All macOS Versions)
Step 1: Open the Terminal App
You’ll need to use the Terminal app to enter a simple command.
How to open Terminal:
- Press Command + Spacebar to open Spotlight Search
- Type “Terminal”
- Press Enter
Alternatively, you can go to Finder > Applications > Utilities > Terminal.
Step 2: Check Your macOS Version
Each macOS version may require a different command.
To find your version:
- Click the Apple logo in the top-left corner
- Select “About This Mac“
- Note the version name (e.g., Ventura, Monterey, Big Sur, etc.)
Commands to Use (Based on Your macOS Version)
For macOS Ventura, Monterey, Big Sur, Sonoma, Sequoia
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
This command clears the DNS cache and restarts the DNS service.
For Catalina, Mojave, High Sierra, Sierra, El Capitan
sudo killall -HUP mDNSResponder
For Yosemite
sudo discoveryutil udnsflushcaches
For Mavericks, Mountain Lion, Lion
sudo killall -HUP mDNSResponder
For Snow Leopard
sudo dscacheutil -flushcache
For Leopard
sudo lookupd -flushcache
Important Notes Before Running the Command
- You must be logged in as an administrator on your Mac.
- After entering the command, your Mac will ask for your password.
- When typing, nothing will appear, this is normal.
- Type your password carefully and press Enter.
- The Terminal will return to a blank line when the command is complete. This means the DNS cache has been cleared successfully.
Clearing the DNS Cache Safe?
Yes, clearing the DNS cache is 100% safe. It does not delete:
- Your browsing history
- Bookmarks
- Saved passwords
- Any files on your Mac
It only removes old website address information to help your Mac connect more efficiently.
Quick Reference Table
| macOS Version | Command to Clear DNS Cache |
| Sonoma, Sequoia, Ventura, Monterey, Big Sur | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Catalina to El Capitan | sudo killall -HUP mDNSResponder |
| Yosemite | sudo discoveryutil udnsflushcaches |
| Mavericks to Lion | sudo killall -HUP mDNSResponder |
| Snow Leopard | sudo dscacheutil -flushcache |
| Leopard | sudo lookupd -flushcache |
Pro Tips
- If websites still don’t load after clearing the cache, try restarting your Wi-Fi.
- You can repeat this DNS flush anytime you face similar internet problems.
- Always double-check the spelling of the command, it must be exact.
If you’re still facing issues after flushing DNS cache, comment below or consult Apple Support.
Related Fixes You Might Need
- Clear browser cache: Helps remove old website data stored by your browser.
- Clear DNS cache on Chrome: Chrome also stores DNS info separately, clear it to fix loading issues.
news via inbox
Subscribe for Weekly Update




