How to clear DNS cache on your Mac

This week’s blog is a simple terminal command to clear out DNS cache. As we all know DNS is used a lot within the computer environment, therefore your DNS cache stores locations (IP addresses) of webservers that contain pages which you have recently viewed. If the location of the web server were to change before the entry in your DNS cache updates, you will be unable to access the site. This tip will clear out any previous cache, should you have this issue, and is also good for other little niggles too:

To start, you need to launch Terminal from Applications>>>Utilities and type the following:

sudo -s

This will prompt you for your machine password (must be an administrator user) then enter:

dscacheutil -flushcache

Then press enter / return.

Remember to type ‘exit’ to leave the terminal session.

This will clear out all DNS cache on the machine you are working on and hopefully correct some issues you are experiencing around DNS.

clear out all dns cache

2 Replies to "How to clear DNS cache on your Mac"

Leave a Reply

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