How to Flush your DNS Cache on Mac

Sometimes a developer has to reset its DNS cache to avoid site preview errors (most of the time when a server transfer occurs).

This article will explain how to flush DNS cache from your Mac!

DNS, or the Domain Name System, translates human-readable domain names (for example, www.amazon.com) to machine-readable IP addresses (for example, 192.0.2.44).

This article will explain how to flush DNS cache from your Mac!

To flush DNS cache on your Mac, open your Terminal and run this command:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

You might need to reset the DNS cache also from your Chrome browser, to do it:

  • visit: chrome://net-internals/#dns
  • click: “Clear host cache” button
  • restart Chrome

--

--

I’m a Software Developer based in Milan. I use Laravel to create awesome Web Applications and I’m an Open Source enthusiast and supporter.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrea Pollastri

I’m a Software Developer based in Milan. I use Laravel to create awesome Web Applications and I’m an Open Source enthusiast and supporter.