Open In App

How to Clear DNS Cache in Safari: A Step by Step Guide

Last Updated : 22 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

When using Safari, you might occasionally encounter issues like websites not loading, seeing outdated versions of pages, or experiencing slow browsing speeds. These problems can sometimes stem from Safari’s DNS cache. Safari maintains its own cache of DNS (Domain Name System) records to make web browsing faster, but if this cache becomes outdated or corrupted, it can cause connectivity problems.

Now, clearing the DNS cache is a simple fix that can get things back on track. In this article, we’ll explain what DNS is, why Safari uses a DNS cache, and walk you through the steps to clear it.

How-to-Clear-DNS-Cache-in-Safari
How to Clear DNS Cache in Safari

Why to Clear Safari’s DNS Cache?

You don’t need to clear the DNS cache regularly, but it’s a good troubleshooting step if you notice:

  • A website you know is active won’t load in Safari.
  • A site shows an outdated version, even though you know it’s been updated.
  • DNS-related error messages like “Safari Can’t Find the Server.”
  • Problems after changing DNS settings or switching networks.

Clearing the cache is safe and has minimal downsides—though the first visit to a site afterward might be slightly slower as Safari performs a new DNS lookup.

How to Clear DNS Cache in Safari - Complete Steps

Safari doesn’t have a direct “clear DNS cache” button like some other browsers, but you can achieve the same result by clearing Safari’s overall cache or using system-level commands. Below are three methods to clear the DNS cache in Safari, with the first method being the most straightforward for most users.

Method 1: Clear Safari’s Cache via the Develop Menu (Recommended)

This method clears Safari’s entire cache, which includes the DNS cache. It’s the easiest approach for most users.

Step 1: Enable the Develop Menu:

  • Open Safari.
open-safari
Open Safari


  • Click Safari in the menu bar at the top of your screen, then select Preferences.
safari-Preferences
Preferences
  • Go to the Advanced tab.
settings-safari
Advanced tab
  • Check the box next to “Show Develop menu in menu bar.”
show-develop-menu
Show Develop menu in menu bar
  • Close the Preferences window.

Step 2: Clear the Cache

  • Click Develop in the menu bar.
develop-menu
Develop
  • Select “Empty Caches” from the dropdown menu.
empty-cache
Empty Caches

This will clear Safari’s cache, including the DNS cache. Note that this also clears other cached data like images and scripts, which might not be ideal if you only want to clear the DNS cache. However, it’s the most accessible method for most users.

Method 2: Use Terminal to Flush DNS Cache in Safari

This method flushes the DNS cache at the system level, affecting all applications, including Safari. It’s more targeted than clearing Safari’s entire cache but requires comfort with using Terminal.

Step 1: Open Terminal:

  • You can find Terminal in Applications > Utilities or by using Spotlight (press Cmd + Space and type “Terminal”).
  • Run the Flush Command:
  • Type the following command and press Enter:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • You’ll be prompted to enter your administrator password. Type it and press Enter. (Note: You won’t see the characters as you type.)

Step 3: Restart Safari

  • Close and reopen Safari to ensure the changes take effect.

This command clears the DNS cache for the entire system, which can be more effective for resolving persistent DNS issues.

Pros and Cons of Each Method

Here’s a quick comparison to help you choose the best method for your needs:

Method

Pros

Pros

Clear Safari’s Cache

  • Easy to do within the browser.
  • No need for Terminal or admin access.
  • Clears all cached data, not just DNS.
  • May temporarily slow down browsing.

Use Terminal

  • Specifically targets the DNS cache.
  • Doesn’t affect other cached data in Safari
  • Requires admin access and Terminal use.
  • Slightly more complex for beginners.

Conclusion

Clearing the DNS cache in Safari is a quick and effective way to fix common browsing issues, from websites not loading to outdated content. Whether you choose to clear Safari’s cache through the Develop menu or use Terminal for a more precise approach, this guide provides the tools you need to refresh Safari’s DNS data. If problems persist, explore additional troubleshooting steps like checking VPN settings or restarting your router.


Next Article

Similar Reads