Clear DNS cache in Mac OS X via Terminal command line (all versions)

The method for clearing or flushing the local cache in Mac OS X has changed over the years. Clear your DNS cache on Yosemite, Mavericks, Lion, Mountain Lion, Snow Leopard and Leopard using the following Terminal commands:

OS X 10.10 Yosemite

sudo discoveryutil udnsflushcaches

OS X 10.9 Mavericks

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

OS X 10.7 Lion & 10.8 Mountain Lion

sudo killall -HUP mDNSResponder

Mac OS X 10.5 Leopard & 10.6 Snow Leopard

sudo dscacheutil -flushcache

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.