Fixing 'Page Not Found' and Other Website Errors by Purging DNS Cache
Useful Information
- If you're encountering difficulties accessing specific websites or have recently made network changes, flushing your DNS cache can be a useful troubleshooting step.
- For Windows users, flush DNS using the command ipconfig /flushdns.
- On the latest macOS versions, clear the cache by running sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
- Rebooting your computer will also automatically clear the DNS cache.
Procedure
Windows

Launch Command Prompt as an Administrator. The simplest method to open Command Prompt with elevated privileges:
- Press the Windows key and type cmd.
- Right-click Command Prompt in the search results.
- Select Run as administrator.
- Click Yes to confirm.

Enter ipconfig /flushdns at the prompt and press ↵ Enter. This action instantly clears your PC's DNS cache.
- To view the contents of your DNS cache without clearing it, use the command ipconfig /displaydns. This command also displays entries from your hosts file.
- If your PC is part of an Active Directory network, consider running ipconfig /registerdns if you encounter hostname resolution issues.
- If you're still experiencing website access problems after clearing your DNS cache, you might need to clear your browser cache.
Mac

Access Terminal. There are two straightforward methods to open Terminal on your Mac:
- In Finder, navigate to the Go menu, then select Utilities, and click Terminal.
- Click the Spotlight icon (magnifying glass) at the top-right of your desktop, type terminal, then double-click Terminal.
- You can also press ⌘ Command+Space to activate Spotlight.

Execute the DNS flush command for your macOS version. The command to use depends on your macOS version:
- Big Sur (macOS 11) and later: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- El Capitan, Sierra, High Sierra, Mojave, & Catalina: sudo killall -HUP mDNSResponder
- Yosemite: sudo discoveryutil udnsflushcaches
- Lion, Mountain Lion, & Mavericks: sudo killall -HUP mDNSResponder

Press ⏎ Return to execute the command. This action clears your Mac's DNS cache.
- If prompted, enter your password to execute the command. This will be the password you use to log in to your Mac. Terminal won't display your keystrokes as you type, but it will register them.
- If you're still encountering website access issues, refer to our guide on addressing common computer network problems. You can also attempt resetting your network.
Linux

Launch a new Terminal window. If you're logged in to your Linux desktop, you can press Ctrl + Alt + T to quickly open a new Terminal.

Execute the DNS flush command for your Linux distribution. The command to execute varies depending on your Linux distribution:
- Ubuntu & Debian:
- Type sudo systemd-resolve --flush-caches and press Enter. In newer versions of Ubuntu, you may need to use sudo resolvectl flush-caches instead.
- To verify that the command worked, execute sudo systemd-resolve --statistics to confirm the cache is empty. In newer versions of Ubuntu, you may need to use sudo resolvectl statistics instead.
- RedHat & CentOS:
- Enter systemctl restart dnsmasq.service and press Enter. You won't receive any confirmation or error messages, so don't be concerned if there's no feedback.
Chromebook

Launch a new browser tab or window. To clear your DNS cache on a Chromebook, utilize Chrome's hidden Net-Internals functionality.

Navigate to chrome://net-internals in your browser. This opens a page where you can access various useful network troubleshooting tools.

Locate and click DNS in the left panel. This will direct you to the DNS Lookup page, where you can search for any domain or host name. Beneath this option, you'll find a button to clear your host cache.

Click on Clear host cache. This action will flush the DNS cache in Chrome (or on your Chromebook).
- No prompt or confirmation will appear, as the process occurs silently in the background.
- If you're still encountering difficulties accessing websites, consider clearing your browser cache.
Helpful Tips
-
Devices automatically clear their DNS caches periodically without requiring manual intervention, so you typically won't need to flush your DNS cache frequently.
-
If you're unable to access a specific website even after flushing DNS, it's possible that the site is currently unavailable.
-
Websites may experience slightly longer loading times the first time you visit them after flushing the DNS cache.