Cleaning the DNS cache

Sometimes when we are working with web projects, we have re-configure the DNS for any reason, so after that, it couldn’t be possible to connect to our page, so this is set of commands for trying to clean the DNS cache in your computer (thanks to @xmz).


For Yosemite, run this command in Terminal:
sudo discoveryutil udnsflushcaches

For Mavericks run:
dscacheutil -flushcache; sudo killall -HUP mDNSResponder

For Lion and Mountain Lion run:
sudo killall -HUP mDNSResponder

For Windows, run this command in command line:
ipconfig /flushdns

For Chrome OS (read more:

  1. Browse to:
  2. Select DNS.
  3. Push the “Clear host cache” button.


That’s it for today!

See you next time.

2 comments on “Cleaning the DNS cache”

Leave a Reply

Your email address will not be published. Required fields are marked *