OSX / TIL

Flush MacOS DNS Cache

Had to restart a dead remote VM server this morning, and it gets its IP address from DHCP. I don’t have physical access to the machine and I needed to SSH into the VM to manually restart some services. My MacOS system was still caching the old DNS address, and IT told me I needed to flush my DNS cache. I had no idea how to do that on MacOS, but turns out to be pretty simple. In the terminal, just run the following command:

sudo killall -HUP mDNSResponder

Magic!

Leave a Reply

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