Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Flush the DNS Cache on a Mac

This guide shows how to clear the saved DNS data on macOS. It helps when a website still opens the old place after you changed its DNS.

Domains and DNS2 min read8 steps

What is a DNS cache?

DNS is like a phone book for the internet. It turns a website name into a number that computers understand. That number is called an IP address.

Your Mac keeps a small list of names it looked up before. This list is the DNS cache. It is like a sticky note so the Mac does not ask again each time. Sometimes the note is old. Then you see the wrong site or an error. Flushing means wiping the notes, so the Mac asks again.

Steps

  1. Open Terminal. Press Command + Space, type Terminal and press Return.
  2. Type this command, then press Return:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    The first part clears the saved list. The second part restarts the helper program that does lookups.
  3. The Mac asks for your password. Type it and press Return. You will not see the letters as you type. That is normal.
  4. Wait for the next prompt. There is usually no message. No message means it worked.

This command works on modern versions of macOS, such as Big Sur, Monterey, Ventura, Sonoma and later. It also works on Catalina and Mojave.

Older versions

Very old versions use other commands. These are examples:

  • OS X Yosemite (10.10): sudo discoveryutil udnsflushcaches
  • OS X Lion to Mavericks: sudo killall -HUP mDNSResponder

Clear your browser too

Browsers can keep their own copy. In Google Chrome, type this in the address bar:

chrome://net-internals/#dns

Then click Clear host cache. Or simply close the browser fully and open it again.

Still seeing the old site?

  1. Try a private or incognito window.
  2. Check that the DNS change was saved at your domain provider.
  3. Wait some hours. DNS changes can take time to spread across the world.
  4. If the problem stays, open a ticket at https://secure.hostvento.com/submitticket.php.
Tip: Flushing the cache only clears your own Mac. It does not speed up DNS for other people.

Quick recap

  • The DNS cache is your Mac's list of saved website lookups.
  • Open Terminal and run the flush command with your password.
  • No message after the command means success.
  • Clear the browser cache too if needed.