OS X Lion - Flush DNS Cache

OS X Lion - Flush DNS Cache

As recently as OS X Snow Leopard, the following command would flush DNS cache:

$ dscacheutil - flushcache

I’m not sure what changed with Lion, but that no longer works. After giving up on figuring out why it’s no longer working, I stumbled upon James Kahn’s Scratchpad and found this solution:

$ sudo killall -HUP mDNSResponder

You can verify that it worked by checking your console (/Applications/Utilities/Console). You should see something like the following:

7:45:22 AM mDNSResponder: SIGHUP: Purge cache