How to clear your DNS on Windows and OSX

flush-dnsSometimes its is necessary to clear out the DNS settings on your development computer, so that you can see new changes.

I find the Google Chrome to be a very aggressive cacher of DNS settings and can results in some very frustrating encounters with clients when you see one things and they see another.

So how do you clear/flush your DNS settings:

Windows

On Windows, you need to be in Admin mode and then start a Command Window (Start->Run->CMD.EXE)

Then enter in :

ipconfig /flushdns

You may also need to restart the network adapter you are using.

Do this by going to your "Network" in Control Panel and then selecting "Change Adapter Settings". Right click on your active network connection and choose disable and do the same action again, but this time click on "Enable"

OSX

It took me quite a while to find a methodology  that actually worked.

I have ended up using

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

You use this by starting a terminal window, and then pasting in the above code and pressing enter.

Its that simple.

Hope it saves your sanity..

Leave a Reply

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