How to reset the DNS cache in OS X

OS X always keeps a local cache of resolved DNS queries (IP address) for future reference. But sometimes it may be necessary to clear (flush) the cache. You can do this with a terminal command, this will refresh the local DNS cache.

When you need to do this?
For example if you hit lot of 404 server error code

Launch Terminal and enter the following command for

OSX 10.10

sudo discoveryutil udnsflushcaches

OSX 10.9

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

OSX 10.7 – 10.8

sudo killall -HUP mDNSResponder

OSX 10.5 – 10.6

sudo dscacheutil -flushcache

3 thoughts on “How to reset the DNS cache in OS X”

Comments are closed.