The commands used for flushing DNS cache on macOS vary depending on the version being used. However, the process remains consistent across all versions. Therefore, this article outlines the steps for clearing DNS cache on macOS Mojave (10.14) and presents a table listing the commands for other versions.
To clear DNS cache on macOS Mojave, use the Terminal application:
- Run terminal.app using your preferred method. You can launch the app from Applications -> Utilities or press Command + Space to launch Spotlight and search for Terminal.
- Type in sudo killall -HUP mDNSResponder and press Return on your keyboard.
- Enter the administrator password for the account in question and press Return.
Flush DNS Commands on Older macOS and Mac OS X Versions
The table below lists the commands for clearing the DNS cache on most macOS and Mac OS X versions. You can copy and paste them directly from the table into your terminal.