How-To Mac Apps

Struggling to connect to certain websites? How to flush the DNS cache in High Sierra

The DNS (Domain Name Server) is responsible for converting numerical IP addresses into readable domains. If your DNS isn’t setup correctly, then your Mac may struggle to load any websites.

If you’ve encountering DNS lookup errors, or it seems to be taking much longer to access certain web domains, then it’s possible the problem may lay with your DNS cache. A corrupted DNS cache can prevent certain servers and domains from being resolved correctly, so you’ll need to clear your DNS cache before your Mac can load these websites properly.

You may also need to reset your local DNS cache if you’ve recently made changes to your DNS settings but those changes haven’t taken affect.

Before resetting your cache, just be aware that this process may temporarily interrupt your Internet connection, so avoid resetting the cache when performing actions that rely on a stable and reliable network connection, for example when you’re midway through downloading a large file, or chatting to someone on Skype.


Resetting your DNS cache from the Terminal

In High Sierra, you can reset the DNS cache by targeting the mDNSResponder process, using your Mac’s Terminal:

  • Open a new Finder window, and navigate to ‘Applications > Utilities.’

  • Double-click the Terminal application. This will launch a new window, where you can enter Terminal commands.
  • Copy/paste the following command into the Terminal:

sudo killall -HUP mDNSResponder

  • Press the ‘Enter’ key on your keyboard.
  • Enter your admin password when prompted
  • After resetting the cache, you may need to quit and then relaunch some Internet-connected applications, before these applications acknowledge the DNS changes.

If you’re not running macOS High Sierra, then you’ll need to use a different Terminal command.

For macOS versions 10.10.0–10.10.3, use the following:

sudo discoveryutil mdnsflushcache

For macOS versions 10.5–10.6, use the following:

sudo dscacheutil -flushcache

Deleting the regular cache

If you’re encountering strange behaviour when trying to access certain websites, then it may help to delete your regular Safari cache. This requires you to uncover Safari’s hidden ‘Develop’ menu, if you haven’t already:

  • Launch the Safari web browser.
  • Select ‘Safari > Preferences..’ from the Safari menu bar.
  • Select the ‘Advanced’ tab.
  • Click ‘Show Develop menu in menu bar.’
  • Close Safari’s ‘Preferences’ menu.
  • You should now notice a new ‘Develop’ option in the menu bar; select it and then click ‘Empty Caches.’
  • Depending on the size of your cache, this can take a few minutes, so you may need to be patient!
  • Once the cache has been cleared, close and then relaunch Safari to make sure these changes have taken effect.

Before you go

After spending over 20 years working with Macs, both old and new, theres a tool I think would be useful to every Mac owner who is experiencing performance issues.

CleanMyMac is highest rated all-round cleaning app for the Mac, it can quickly diagnose and solve a whole plethora of common (but sometimes tedious to fix) issues at the click of a button. It also just happens to resolve many of the issues covered in the speed up section of this site, so Download CleanMyMac to get your Mac back up to speed today.

mac-pc

About the author

Chris

I've been a passionate evangelist for Apple and the Macintosh throughout my working life, my first love was a Quadra 605 working with a small creative agency in the south of Norfolk UK in the mid 1990's, I later progressed to other roles in other Macintosh dominated industries, first as a Senior graphic designer at a small printing company and then a production manager at Guardian Media Group. As the publishing and printing sector wained I moved into Internet Marketing and in 2006 co-founded blurtit.com which grew to become one the top 200 visited sites in the US (according to Quantcast), at its peak receiving over 15 million visits per month. For the last ten years I have worked as an Affiliate and Consultant to many different business and start ups, my key skill set being online marketing, on page monetisation, landing page optimisation and traffic generation, if you would like to hire me or discuss your current project please reach out to me here.

You can also follow me on: and

Add Comment

Click here to post a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.