DNS request are usually cached, that’s good as it help to speeds up the lookups within the same host but sometimes we will want to clear the cache so it don’t hold the values that are no longer valid or we edited hosts file to block or redirect hosts or IP. To clear DNS cache in Mac OSX, we can do it with the help of Terminal.
Mac OSX 10.10
Open Terminal.app and type this command:
dscacheutil -flushcache
Check How to Clear DNS Cache with discoveryutil in Mac OS X Yosemite
For older versions of OS X go here.
If you need to edit hosts file go here.
Mark Binger says
Great! Thanks, you made my day.
Daniel says
I think you’ll find that the dscacheutil trick doesn’t always work on 10.10. It certainly didn’t for me!
Here’s the command I had to use:
sudo discoveryutil udnsflushcaches