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
- Open Terminal. Press Command + Space, type Terminal and press Return.
- Type this command, then press Return:
The first part clears the saved list. The second part restarts the helper program that does lookups.sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - The Mac asks for your password. Type it and press Return. You will not see the letters as you type. That is normal.
- 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?
- Try a private or incognito window.
- Check that the DNS change was saved at your domain provider.
- Wait some hours. DNS changes can take time to spread across the world.
- If the problem stays, open a ticket at https://secure.hostvento.com/submitticket.php.
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.