5 February 2024

How to Clear DNS Cache in macOS Sonoma

By Ronald Smith

Are you having trouble with your macOS DNS settings? I’m here to help you through the process of flushing and resetting the DNS cache on macOS Sonoma and older versions.

If you use a Mac and have recently made changes to your DNS settings, it’s a good idea to clear the DNS cache. But why is it so important to do this?

It’s important because when your DNS is cached, the nameservers or domain names might not resolve to the correct IP address. This can lead to you being directed to a cached version of a website or even prevent you from accessing certain websites altogether.

So, how can you clear your Mac’s DNS cache?

I’m going to show you how to easily clear and reset the DNS cache on the latest macOS Sonoma (Version 14.0).

If you’re using an older version of macOS like Ventura, follow these steps to clear your cache.

Step 1.

Open the Terminal app. It’s easy! Just press Command + Space on your keyboard to bring up Spotlight Search. Then, type “Terminal” and hit Enter.

How to Clear DNS Cache in macOS Sonoma

Second Step – Refreshing the System

Here’s what you need to do:

1. Open Terminal by launching the Application folder, clicking on Utilities, and selecting Terminal.

2. Once the Terminal is open, copy and paste the following command into the text field:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
3. Press the Return key on your keyboard to execute the command.

4. Wait for the process to complete. You may see some lines of text appearing in the Terminal window.

5. Once the process is finished, close the Terminal window.

6. Now, your system’s cache has been refreshed, and any issues related to DNS resolution should be resolved.

7. If you encounter any further problems, feel free to ask for assistance.

Here’s a screenshot to help you:

How to Clear DNS Cache in macOS Sonoma

Look, I need you to do something for me. Take a moment to enter your password and hit the Return key again. Just like that. Easy, right?

How to Clear DNS Cache in macOS Sonoma

Step 4.

To close the Terminal, just press Command + Q on your keyboard.

That’s all! Now your DNS cache should be refreshed and cleared.

Clearing DNS Cache on Older macOS

If you have an older version of macOS, the command mentioned before might not work for you. Take a look at the table below to find the right command to clear the DNS cache based on your macOS version.

macOS Version
Command
Ventura (Ver. 13) Press “sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Monterey (Ver. 12) Press “sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Big Sur (Ver. 11) Press “sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Catalina (Ver. 10.15) Press “sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Mojave (Ver. 10.14) Press “sudo killall -HUP mDNSResponder; sleep 2” in the Terminal and hit Enter.
High Sierra (Ver. 10.13) Press “sudo killall -HUP mDNSResponder; sleep 2” in the Terminal and hit Enter.
Sierra (Ver. 10.12) Press “sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
El Capitan (Ver. 10.11) Press “sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Yosemite (Ver. 10.10) Press “sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches” in the Terminal and hit Enter.
Mavericks (Ver. 10.9) Press “dscacheutil -flushcache; sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Mountain Lion (Ver. 10.8) Press “sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Lion (Ver. 10.7) Press “sudo killall -HUP mDNSResponder” in the Terminal and hit Enter.
Snow Leopard (Ver. 10.6) Press “sudo dscacheutil -flushcache” in the Terminal and hit Enter.
Leopard (Ver. 10.5) Press “sudo dscacheutil -flushcache” in the Terminal and hit Enter.
Tiger (Ver. 10.4) Press “lookupd -flushcache” in the Terminal and hit Enter.
Frequently Asked Questions:

1. Is it safe to clean up DNS cache?

Yes, it is safe to clear the DNS cache on your Mac. The DNS cache stores information about websites you’ve visited before, such as their IP addresses. By clearing the cache, you can resolve issues with accessing certain websites or update DNS records if needed.

2. Does clearing DNS cache speed up the internet?

Clearing the DNS cache on your Mac is generally a good practice for keeping your system healthy and avoiding potential issues with website access. However, it may not always result in a significant boost in internet speed.

3. Will DNS on my Mac update automatically?

Yes, the DNS on your Mac will update automatically. When you visit a website, your Mac’s DNS system will automatically retrieve the latest IP address associated with that site. This ensures that you always have the most up-to-date information when browsing the web.