How to clear DNS cache on Mac

If you're having trouble loading a website in your browser, your DNS cache could be the culprit. You can delete this cache without harming anything on your Mac.

Run the command to clear DNS cache

Next, you will need to use the Terminal utility to execute the command and clear the DNS cache on your Mac. Open Terminal by finding it using Spotlight, Launchpad, or Finder. Now, simply type the following command into the Terminal app and press the Return key:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

How to clear DNS cache on Mac Picture 1How to clear DNS cache on Mac Picture 1

 If you notice, each command has a sudo prefix; This means you will be asked to enter your Mac admin password before you can run the command. Make sure you have your password handy before trying and executing this command on your Mac.

Why should you clear DNS cache on Mac?

In general, you should clear your DNS cache when you encounter DNS-related errors on your Mac. This includes any DNS error messages you see in your browser or apps on your Mac. Learn more about what a DNS server is and why it might not be available.

Clearing DNS cache helps fix some web browsing-related problems. This is because of the way DNS works on your computer. You may already know that DNS translates your domain name into an IP address. If the DNS cache is corrupted or there is another problem with it, the translation will fail, leading to interrupted browsing sessions. Clearing DNS cache helps fix these problems on your Mac.

Does clearing DNS cache cause any problems?

When clearing DNS cache, you only delete entries stored in the DNS cache. You will not have any problems deleting these DNS cache files. The next time you try to connect to a website from your web browser, the latter will fetch new entries from the DNS server. The DNS cache will save these entries and the cycle will continue.

Clearing your DNS cache doesn't harm your Mac in any way - you can do it without hesitation whenever you encounter DNS problems. As you can see, one simple command is all you need to fix many server-related domain name problems on your computer.

5 ★ | 1 Vote