How to Flush DNS on Mac?

The DNS cache is a temporary database that contains records of all your computer’s recent visits and attempted visits to websites in your browser. This is to ensure that pages load faster when you visit them again so that the computer can link to them quickly. The DNS cache exists on all computers, regardless of the operating system version. Periodically, this cache should be cleaned because the data in the cache becomes outdated and websites do not load or load incorrectly (e.g. with error 404).

This instruction describes how to flush DNS on Mac and improve the loading speed of Internet pages in Safari, Opera, Google Chrome, and other browsers.

Why the DNS Cache Needs to Be Cleaned Periodically on a Mac?

This procedure is not required, but in many cases, it helps solve Internet connection problems on macOS computers. How DNS works are very similar to how your smartphone’s contact list works. The Internet uses a domain name system to maintain an index of all publicly accessible websites and their corresponding IP addresses. Similarly, thanks to your contact list, you don’t need to remember each person’s phone number to communicate with them. In this way, DNS is used to avoid having to remember the IP address of every website, which is the only way your network equipment can communicate with websites.

You should also clear the DNS cache after changing your Internet router. If you want to replace your router, use these helpful tips for choosing a Wi-Fi router.

Each time a user visits a website by its hostname, the web browser initiates a request to the Internet, but that request cannot be completed until the site name has been “converted” into an IP address. The DNS cache tries to speed up the process even more. It remembers previous visits and when new searches are made, it tries to find the very page to go to again. If the data about the page is stored in the cache, the transition will be faster. However, sometimes the data in the cache does not match the reality. For example, if the site administrator has made some changes in the domain name. In this case, you need to clear the cache, otherwise, you won’t be able to enter the page through the browser.

You can flush DNS on Mac without losing your saved passwords and other important information on browser bookmarked sites. This procedure does not erase your browsing history or other data.

Step-By-Step Guide on How to Clear DNS Cache on Mac

Use these instructions to clear the DNS cache on macOS. You can do this on any version of the Mac operating system (for MacBook, Mac Mini, iMac).

  1. Go to Terminal;
    mac how to flush dns
  2. Enter the command:
    sudo dscacheutil -flushcache
    how to flush dns on mac
    
  3. Type in the admin password;
  4. After clearing the DNS cache, the command cursor will move to a new line.

If the specified command in the Terminal did not work, try the alternative command sudo killall -HUP mDNSResponder for the latest versions of macOS, starting with High Sierra 10.13.x.

If resetting the cache didn’t help solve the problem, it may lie in the service itself. In this case, you should test the Internet connection through a third-party service, for example, Google Public DNS. This is recommended only for experienced users.

Cyril Kardashevsky

Leave a Reply

Your email address will not be published. Required fields are marked *