How to Flush Your DNS Cache


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.

  1. Press the Windows Key on your keyboard or click the Start button.
  2. Type cmd.
  3. Right-click on Command Prompt and select Run as administrator.
  4. A black window will appear. Type the following command and press Enter:
    ipconfig /flushdns
  5. 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).

  1. Press Command + Space to open Spotlight Search.
  2. Type Terminal and double-click the application to open it.
  3. Copy and paste the following command into the window and press Enter:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  4. 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.
  5. 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.

  1. Open your Terminal (usually Ctrl + Alt + T).
  2. Type the following command and press Enter:
    sudo resolvectl flush-caches
  3. If that command is not found, try the alternative:
    sudo systemd-resolve --flush-caches
  4. To verify it worked, you can run:
    resolvectl statistics
    Look for the "Current Cache Size" which should now be 0.

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:

  1. Open a new tab and type this address into the bar: chrome://net-internals/#dns
  2. Click the button labelled Clear host cache.

Was this answer helpful?

One email a month. Endless business benefits.

Don't miss out on WMTWWFY — the newsletter that keeps your website fast, safe, and visible.

« Back
Spinner
aluminium-anthropoid Security Check