Clearing Your DNS Cache

Your computer's DNS cache stores the IP addresses of websites you have recently visited so they load faster. If a site's IP address changes before the cache updates — for example, after you switch hosts or update DNS records — you may see the wrong page or get a "404 Not Found" error. Clearing (flushing) the DNS cache forces your computer to look up the current IP addresses again.

When to Clear Your DNS Cache

Flush your DNS cache when you change a domain's DNS records, move hosts, or troubleshoot site-access errors that aren't caused by the site itself. After you flush the cache, your computer queries your configured nameservers for fresh DNS information.

Note: The following commands and instructions are provided for troubleshooting website access issues. Exact Hosting assumes no responsibility or liability for their use.

Before You Begin

  • Administrator access to your computer. Flushing the DNS cache requires running commands as an administrator (Windows) or with sudo (macOS).
  • Your operating system version. The exact command varies by Windows version and macOS version, so confirm which one you are running before you begin.
  • A closed browser, ideally. Close and reopen your browser after flushing so it also reloads DNS data.

Clear the DNS Cache on Windows

The same flush command (ipconfig /flushdns) works across modern Windows versions. The difference is how you open an elevated Command Prompt.

Windows 10 and 11

  1. Click the Start menu and type cmd.
  2. Right-click Command Prompt and select Run as administrator.
  3. Run the following command: ipconfig /flushdns
  4. Confirm the success message: Windows IP configuration successfully flushed the DNS Resolver Cache.

Windows 8

  1. Open the Start menu and type cmd.
  2. Right-click Command Prompt and select Run as administrator.
  3. Run the following command: ipconfig /flushdns
  4. Confirm the success message: Windows IP configuration successfully flushed the DNS Resolver Cache.

Windows 7

  1. Click Start.
  2. In the Start menu search box, type cmd.
  3. Right-click Command Prompt and select Run as administrator.
  4. Run the following command: ipconfig /flushdns
  5. Confirm the success message: Windows IP configuration successfully flushed the DNS Resolver Cache.

Windows XP, 2000, and Vista

Warning: Windows XP, 2000, and Vista are no longer supported by Microsoft. We strongly recommend upgrading to a supported version for security reasons. [OUTDATED — UPDATE NEEDED]

  1. Click Start.
  2. Click Run. On Vista, if you do not see Run, type run into the Search bar.
  3. In the Run text box, enter the following command: ipconfig /flushdns
  4. Confirm the success message: Successfully flushed the DNS Resolver Cache.

Clear the DNS Cache on macOS

On macOS, you flush the cache from the Terminal using a sudo command. The exact command depends on your macOS version. A successful flush does not return any output.

Open Terminal

  1. Open Applications.
  2. Open Utilities.
  3. Open Terminal.

Run the command for your macOS version

macOS version

Command

10.10.4 and above (including modern macOS)

sudo killall -HUP mDNSResponder

10.10.1, 10.10.2, and 10.10.3

sudo discoveryutil mdnsflushcache

10.7, 10.8, and 10.9

sudo killall -HUP mDNSResponder

10.5 and 10.6

sudo dscacheutil -flushcache

Tip: When prompted, enter your Mac's administrator password. The cursor will not move while you type the password — this is normal.

Note: macOS versions 10.10 and earlier are no longer supported by Apple and may not receive security updates. The current macOS DNS flush command is the same as the modern command above.

Next Steps

  • Restart your browser. Browsers maintain their own DNS cache. Close and reopen your browser, or clear its cache, to make sure it picks up the new DNS information.
  • Verify DNS propagation. Use a third-party DNS lookup tool to confirm the domain is resolving to the expected IP address worldwide.
  • Review your DNS records. If the site still doesn't load, confirm the DNS records are correct. See Managing DNS Records and Nameservers.

Questions? Contact Exact Hosting Support.

How helpful was this article?

Thanks for your feedback!

Do you still need help? If so please submit a request here.