Quick Links

If you're having trouble loading websites in your browser, your DNS cache might be the culprit. You can clear this cache without harming anything on your Mac, and this can potentially fix your website-loading issues. We'll show you how to do so by running a Terminal command.

Run a Command to Flush the DNS Cache

Next, you'll need to use the Terminal utility to execute a command and flush the DNS cache on your Mac. Open Terminal by finding it with Spotlight, Launchpad, or Finder. Now, simply type the following command into the Terminal app and hit the Return key:

        sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    
Entering the DNS flush command in the Terminal

If you notice, each command is prefixed with sudo; this means you'll be asked to enter your Mac's admin password before you can run a command. Make sure you have your password handy before you try and execute this command on your Mac.

Why Should You Flush the DNS Cache on a Mac?

Generally, you should clear the DNS cache when you experience DNS-related errors on your Mac. This includes any DNS error messages you see in your browsers or apps on your Mac. Find out more about what a DNS server is and why it may be unavailable.

Clearing the DNS cache helps fix some browsing-related issues. This is because of how the DNS works on your computer. You may already know that DNS translates your domain names to IP addresses. If the DNS cache gets corrupted or there are other issues with it, that translation fails, which results in interrupted browsing sessions. Flushing the DNS cache helps fix these issues on your Mac.

Does Flushing the DNS Cache Cause Any Issues?

When you flush the DNS cache, you're only deleting the cached entries of the DNS. You won't experience any issues from removing these DNS cache files. The next time you try to connect to a site from your web browser, the latter will fetch fresh entries from the DNS server. The DNS cache will save these entries, and the cycle will continue.

Flushing the DNS cache doesn't harm your Mac in any way—you can do this without any hesitation whenever you encounter a DNS issue. As you've seen, a simple command is all you need to fix many server-related domain name problems on your computer.