If you have recently moved your website to a new server or changed your email settings (like your MX records), you might find that you still see the old site or that your changes haven't taken effect on your computer. This is often because your operating system stores a local copy of DNS records to speed up browsing.
This "cache" can sometimes get out of date. "Flushing" it forces your computer to delete the old records and look up the new, correct ones immediately.
Windows (10 and 11)
Flushing the DNS cache on Windows is very quick and done via the Command Prompt.
- Press the Windows Key on your keyboard or click the Start button.
- Type
cmd. - Right-click on Command Prompt and select Run as administrator.
- A black window will appear. Type the following command and press Enter:
ipconfig /flushdns - You should see a message saying: "Successfully flushed the DNS Resolver Cache."
macOS
On Apple computers, you need to use the Terminal application. The command varies slightly depending on your version of macOS, but the following command works for all modern versions (macOS Big Sur, Monterey, Ventura, Sonoma, and Sequoia).
- Press Command + Space to open Spotlight Search.
- Type
Terminaland double-click the application to open it. - Copy and paste the following command into the window and press Enter:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - You will be asked for your Mac user password.
Note: When you type your password, no characters will appear on the screen. This is a security feature. Just type the password blindly and press Enter. - The command will run silently. If you don't see an error, it was successful.
Linux (Ubuntu/Debian)
Most modern Linux distributions (like Ubuntu 18.04+) use systemd-resolved for DNS services.
- Open your Terminal (usually Ctrl + Alt + T).
- Type the following command and press Enter:
sudo resolvectl flush-caches - If that command is not found, try the alternative:
sudo systemd-resolve --flush-caches - To verify it worked, you can run:
Look for the "Current Cache Size" which should now be 0.resolvectl statistics
Still Seeing the Old Site? Check Your Browser
Sometimes, even after flushing your OS cache, your web browser (especially Google Chrome) might be holding onto its own internal cache.
For Google Chrome users:
- Open a new tab and type this address into the bar:
chrome://net-internals/#dns - Click the button labelled Clear host cache.