Cloud Service >> Knowledgebase >> Domains & DNS >> How to Flush DNS Cache on MacOS?
submit query

Cut Hosting Costs! Submit Query Today!

How to Flush DNS Cache on MacOS?

Clearing your DNS cache often solves connection problems, enhances security, and ensures that you link to updated versions of specific sites. A Mac user may sometimes need to flush his or her DNS cache, although many users have no idea how to accomplish this on macOS. 

We will lead you through this critically important procedure and demonstrate how to do it on different macOS releases.

Why Flush DNS Cache?

Flushing your DNS cache can be beneficial in several scenarios: 

Resolve Connectivity Issues: This may be due to some websites being blocked, or you are encountering some error messages; either way, flushing the DNS cache modifies or removes the corrupt/irrelevant DNS entries.

Update Changes: If a website has recently changed its location in the internet space using an IP address or has relocated to a new server to accommodate it, your DNS cache may have outdated records, so it may not locate a server. Flushing the cache renders a new DNS address, helping you get the latest address.

Enhance Security: Specifically, the DNS cache is subject to cache poisoning, where a domain name can be mapped to an incorrect IP address. It can clear such risks hence the following:

Improve Performance: The problem arises from the fact that the DNS cache collects all the domains that a particular DNS server has encountered over a period of time and, therefore, slows the process down. By frequently emptying the cache, the system can run optimally, as there would be more free space to navigate within.

How to Flush DNS Cache on macOS

The method to flush the DNS cache can vary depending on the version of macOS you are using. Below are step-by-step instructions for different macOS versions.

Flushing DNS Cache on macOS Monterey (12.0) and Ventura (13.0)

Open Terminal: Find Terminal by going to Applications > Utilities > Terminal

Enter the Command

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Enter Your Password: You will be prompted to enter your macOS password. Type it and press Enter. 

Check for Errors: If there are no errors, the DNS cache has been flushed successfully. You can now close Terminal.

Flushing DNS Cache on macOS Big Sur (11.0)

- Open Terminal: Follow the same steps as above to open Terminal.

Enter the Command: In Terminal, type the following command and press Enter:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

- Enter Your Password: Enter your password when prompted and press Enter.

- Check for Errors: The process should complete without any error messages. Close Terminal once done.

Flushing DNS Cache on macOS Catalina (10.15)

Open Terminal: Launch Terminal from Applications > Utilities or use Spotlight.

Enter the Command: Type the following in Terminal and press Enter:

sudo killall -HUP mDNSResponder

Enter Your Password: Input your macOS password and press Enter.

Check for Errors: If no errors are displayed–your DNS cache is successfully flushed.

Flushing DNS Cache on macOS Mojave (10.14) and Earlier

Open Terminal: Access Terminal from Applications > Utilities or through Spotlight.

Enter the Command: Use the following command based on your macOS version:

Mojave (10.14) and High Sierra (10.13):
sudo killall -HUP mDNSResponder

 

Sierra (10.12):
sudo killall -HUP mDNSResponder

sudo killall mDNSResponderHelper

 

El Capitan (10.11):
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

 

Yosemite (10.10):
sudo discoveryutil udnsflushcaches

 

Mavericks (10.9) and Mountain Lion (10.8):
sudo killall -HUP mDNSResponder

Enter Your Password: Enter your password when prompted and press Enter.

Check for Errors: If no errors are reported, the DNS cache should be cleared. Close the Terminal to complete the process.

Additional Tips

Restart Your Mac: If you encounter any issues after flushing the DNS cache, consider restarting your Mac. This can help clear any residual problems.

Router DNS Cache: Sometimes, the issue might be with your router’s DNS cache. Restarting your router can flush its DNS cache, potentially resolving connectivity issues.

Final Words

Flushing the DNS cache on macOS is very easy and beneficial for improving connectivity, updating DNS changes, and security utilities. As seen, you can perform the procedures outlined above relevant to your macOS version to help yourself clear the DNS cache and ensure it contains recent and correct information. Cache clearing is also useful for average system performance and security because it deserves frequent attention.

This guide should solve all your Mac DNS problems; make sure to bookmark it. Please remember that you can perform this task several times to optimize your network connections.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!