How do I clean my DNS on my Mac?

Aug 04, 20247 mins read

Learn how to clean DNS on your Mac quickly and efficiently with these methods: using terminal commands like 'sudo killall -HUP mDNSResponder', navigating through System Preferences, or utilizing third-party tools for enhanced network performance and connectivity troubleshooting.

66
 

Cleaning DNS cache in macOS is a common need, but the methods can vary depending on the operating system version. Here are several approaches for different macOS versions:

1️⃣ macOS Sierra (10.12) and newer versions

For macOS Sierra (10.12) and newer versions like macOS Monterey, macOS Big Sur, macOS Catalina, macOS Mojave, and macOS High Sierra:

  • Open Terminal: Go to "Applications" > "Utilities" folder in Finder, find and open "Terminal," or use Spotlight to quickly locate it.

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

    sudo killall -HUP mDNSResponder
    

    This command sends a HUP (hang up) signal to the mDNSResponder process, forcing it to reload its configuration and clear the cache.

  • Enter Password: You may be prompted to enter your administrator password. When typing your password, no characters will appear on the screen, which is normal. Press Enter after entering the password.

2️⃣ macOS Yosemite (10.10) to macOS El Capitan (10.11)

For these versions, in addition to the above command, you can first try flushing the system cache with:

sudo dscacheutil -flushcache

Followed by:

sudo killall -HUP mDNSResponder

3️⃣ macOS Mavericks (10.9) and earlier versions

For macOS Mavericks (10.9) and earlier versions, you can use the same command combination as for Yosemite to El Capitan.

Notes:

  • After executing these commands, you may not see any confirmation message. No errors usually indicate successful execution.
  • Clearing DNS cache does not affect normal network activities but may slightly slow down initial domain name resolution temporarily.
  • Ensure the commands match your macOS version.

4️⃣ Using Third-Party Tools

If you find manual commands cumbersome or prefer a more intuitive method, consider using third-party tools like CleanMyMac X, which offers various system optimization features, including clearing DNS cache, in a user-friendly interface.

These methods help ensure smooth operation and resolve network connectivity issues effectively on macOS systems.
Image NewsLetter
Icon primary
Newsletter

Subscribe our newsletter

By clicking the button, you are agreeing with our Term & Conditions