Clear your Mac's DNS cache so websites load fresh
Quick answer
Turn Wi-Fi off and on again, or restart your Mac, and the DNS cache starts fresh. If you're comfortable with Terminal, the command below clears it without a restart.
Why it happens
DNS is how your Mac turns a web address into the number of the server behind it. Your Mac remembers those answers for a while to save time. If a site moves to a new server, the old answer can send you to the wrong place until it's cleared.
How to fix it
Open System Settings, click Wi-Fi and turn the switch off. Wait about ten seconds, then turn it back on and let it rejoin your network.
Wi-Fi
Quit your web browser with Command-Q and open it again, because browsers keep their own short-term cache. Then try the website.
If it still goes to the old place, restart your Mac from the Apple menu. A restart clears the DNS cache completely.
Used to Terminal? You can clear the cache without restarting. Open Terminal and run the command in the Terminal section below. It asks for your Mac password, and nothing appears on screen while you type it, which is normal.
Terminal
Still not fixed?
Try the website in a private window. If it loads there, clear your browser's history and website data for that site.
Restart your router: unplug it for 30 seconds, plug it back in and wait two minutes. Routers keep their own DNS answers too.
Change your DNS server. In Wi-Fi settings, click Details next to your network, click DNS, add a public server with the plus button and click OK.
Wi-Fi›Details…›DNS
If the site fails on every device and every network, it's likely down, so wait and try later. If only your Mac can't reach sites after all these steps, contact your internet provider or Apple Support.
Terminal
Open Terminal (Applications › Utilities), paste this line and press Return.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderNothing to undo.
This one needs your Mac's admin password. Copy it and run it yourself in Terminal, and only if you're comfortable doing that.
Pro details
Clears the DNS cache and restarts the DNS responder.
Questions people ask
How do I flush DNS on a Mac?
Turn Wi-Fi off and on or restart the Mac. In Terminal, the command shown on this page clears it straight away.
Does restarting a Mac clear the DNS cache?
Yes. A restart starts the DNS cache fresh.
Is it safe to flush DNS on a Mac?
Yes. It only clears saved website addresses, and your Mac looks them up again as you browse.
Related fixes
Glad it worked.
Sorry it didn't. Tell us what happened and we'll fix this page.
Next time, just ask your Mac.
Press ⌃ ⌥ Space and type “flush dns mac”. PinSet shows you these steps. One of 2,400+ checked Mac fixes. Works offline.
7 fixes free · Works offline · macOS 26 and 27