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!

What is DNS?

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!

Flush DNS cache on 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 engineer based in Milan. Always looking to discover new development methods and technologies, I am an open source enthusiast and supporter.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Password Protect a Folder Without Any Software?

“Defend the Web” write-up (Crypt3 / Crypt — decoding morse code)

Top Spam Campaigns to Start this Holiday Season

FairyProof’s Analysis of the Latest Attack on Opensea

How Best to Bring Comfort to Cyber Criminals

Genaro Network: The Metaverse and Decentralized Storage

How I was able to delete any image in Facebook community question forum

Frutti Dino WhiteList is Now Opening!

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

Andrea Pollastri

I’m a software engineer based in Milan. Always looking to discover new development methods and technologies, I am an open source enthusiast and supporter.

More from Medium

How to build a CDN (2/3): server and reverse proxy configuration

What the hell is this Docker ?

Github Actions — Mask Every secret

Reviving data from a legacy Firebird database