Skip to main content
ramit's kb

Flush Your Mac's DNS Cache for a Fresh Start

Stuck in the Web? Flush Your Mac's DNS Cache for a Fresh Start #

Ever feel like your Mac is taking forever to load websites, even though your internet seems fine? Sometimes, outdated information stored in your computer's DNS cache can be the culprit. Think of it like a phonebook for websites, but if the listings are incorrect, you'll end up lost!

Here's the good news: flushing the DNS cache is a quick and easy fix. It clears out the old data and forces your Mac to get the latest website addresses, potentially speeding things up. But before we dive in, remember:

Use this trick responsibly: Flushing the cache won't harm your Mac, but the initial website load might be slower as it retrieves fresh information.

Ready to clear the cobwebs? Open Terminal (Spotlight search > Terminal). Copy and paste this code:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder;

Enter your password (it won't show while typing) and press Enter. That's it! Your DNS cache is now sparkling clean.

Bonus tip: If you frequently encounter DNS issues, consider setting up a custom DNS server for faster and more reliable resolution. But that's a topic for another day!

So, the next time your Mac gets stuck in the web, remember this simple DNS flush trick. Happy browsing!