How to Flush DNS Cache on MacBook: Terminal Command

👁45views

Flushing DNS cache on a MacBook requires opening Terminal and running `sudo dscacheutil flushcache; sudo killall HUP mDNSResponder`. Enter your administrator password when prompted. This command works on macOS Monterey, Ventura, and Sonoma. Older macOS versions may use slightly different commands, but this two part command covers most modern Mac systems.

CloudScale AI SEO: Article Summary
  • 1.
    What it is
    This article provides a terminal command to clear DNS cache on Mac computers using a sudo command in Terminal.
  • 2.
    Why it matters
    Flushing DNS cache can resolve website loading issues, connection problems, or force your system to fetch fresh DNS records when network configurations change.
  • 3.
    Key takeaway
    Use Terminal with a sudo command to quickly flush DNS cache on Mac when experiencing network connectivity issues.
~1 min read

I am not going to tell you why you would need to flush your DNS cache (you will know if you need to). So, to flush DNS on a mac simply fire up Terminal and run the following sudo command:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder