Are you having trouble accessing certain websites? Try flushing your DNS cache! If the IP address of a website you've recently visited has changed since the last time you accessed it in your browser, you might see a "Page not found" error until your DNS resolver cache is cleared. While this cache (which is different from your web browser's cache ) also clears automatically, doing a manual DNS flush will instantly clear those old stored addresses, which may restore your access to your favorite website. This wikiHow guide will show you the easiest ways to flush your DNS cache on a Windows or Linux PC, Mac, and Chromebook.
Flushing Your DNS
Flush Chrome's DNS by typing chrome://net-internals/#dns in the address bar and hitting enter. In Windows, use the command ipconfig /flushdns. Restarting your computer also flushes your DNS automatically.
Steps
-
Open a Command Prompt window as an administrator. The easiest way to open Command Prompt with elevated access is: [1] X Research source
- Press the Windows key on your keyboard and type cmd .
- Right-click Command Prompt in the search results.
- Click Run as administrator .
- Click Yes to confirm.
-
Type ipconfig /flushdns at the prompt and press ↵ Enter . This immediately flushes your PC's DNS cache. [2] X Research source
- If you just want to see the contents of your DNS cache without flushing it, run the command ipconfig /displaydns instead. This command also displays entries from your hosts file .
- If your PC is a part of an Active Directory network, you may also need to run the command ipconfig /registerdns if you can't resolve other hostnames on your network.
- If you're still having trouble accessing websites after clearing your DNS cache, you may also need to clear your browser cache .
-
Open a Terminal window. There are two easy ways to open Terminal on your Mac:
- Open Finder, click the Go menu, select Utilities , and then select Terminal . [3] X Research source
- Click the Spotlight icon (the magnifying glass) at the top-right corner of your desktop, type terminal
, and then double-click Terminal
.
- You can also press ⌘ Command + Space to open Spotlight.
-
Type the DNS flush command for your version of macOS. The command you'll need to type depends on your version of macOS: [4] X Research source
- 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
- Big Sur (macOS 11) and later:
-
Press ⏎ Return to run the command. This clears your Mac's DNS cache.
- If prompted, enter your password to run the command. This will be the password you enter when logging in to your Mac. Terminal won't show your keystrokes as you type, but it will detect them.
- If you're still having trouble accessing websites, check out our guide to fixing common computer network issues. You can also try resetting your network .
-
Open a new Terminal window. If you're logged in on your Linux desktop, you can press Ctrl + Alt + T to open a new Terminal quickly . [5] X Research source
-
Run the DNS flush command for your Linux variant. The command you'll use will be different depending on which version of Linux you're using:
- Ubuntu & Debian:
- Type sudo systemd-resolve --flush-caches and press Enter . In newer version of Ubuntu you may have to use command sudo resolvectl flush-caches instead. [6] X Research source
- To make sure the command worked, run the command sudo systemd-resolve --statistics to make sure the cache is empty. In newer version of Ubuntu you may have to use command sudo resolvectl statistics instead. [7] X Research source
- RedHat & CentOS:
- Type systemctl restart dnsmasq.service and press Enter . You won't see any confirmation or errors, so don't worry if you don't get any feedback.
- Ubuntu & Debian:
-
Open a new browser tab or window. To flush your DNS on a Chromebook, you'll need to use the hidden Net-Internals feature in Chrome. [8] X Research source
-
Go to chrome://net-internals in your browser. This opens a page where you can access a few handy network troubleshooting tools.
-
Click DNS in the left panel. Now you'll see the DNS Lookup page, where you can look up any domain or host name. You'll also see a button below this option to clear your host cache.
-
Click Clear host cache . This flushes the DNS cache in Chrome (or on your Chromebook). [9] X Research source
- Don't be alarmed if you don't see a prompt or confirmation, as everything happens quietly in the background.
- If you're still having trouble accessing websites, you can also try clearing your browser cache ,
Community Q&A
-
QuestionIn Windows I entered the "ipconfig /flushdns" command and received the following: "The requested operation requires elevation." What does this mean?Community AnswerIt is because you don't have administrative access. Open your cmd using administrator access (usually known as "Run As Administrator").
-
QuestionWhy do some websites work and others cannot be found?Community AnswerYour wifi firewall or the country may have some have censorship. Change your VPN to see if that works.
-
QuestionHow can I flush a D.N.S. PC laptop or mobile device?Community AnswerOn Windows, open Command Prompt and after the prompt, without the quotes, type in "ipconfig/flushdns".
Video
Tips
- Websites may take a bit longer to load the first time you access them after flushing the DNS cache.Thanks
- All devices clear their DNS caches regularly without any human intervention, so you shouldn't have to flush your DNS cache often.Thanks
- If you can't access one website in particular and flushing DNS didn't fix the problem, the site might be down.Thanks
References
- ↑ https://grok.lsu.edu/article.aspx?articleid=13578
- ↑ https://www.freecodecamp.org/news/flushdns-how-to-flush-dns-with-the-windows-ipconfig-flushdns-command/
- ↑ https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac
- ↑ https://www.freecodecamp.org/news/how-to-flush-dns-on-mac-macos-clear-dns-cache/
- ↑ https://ubuntu.com/tutorials/command-line-for-beginners#3-opening-a-terminal
- ↑ https://world.siteground.com/kb/flush-dns-cache-in-linux/#How_to_flush_the_DNS_cache_on_Linux
- ↑ https://world.siteground.com/kb/flush-dns-cache-in-linux/#How_to_flush_the_DNS_cache_on_Linux
- ↑ https://www.dell.com/support/manuals/en-us/chromebook-11-5190-laptop/chromebook_5190_om/chrome-commands?guid=guid-ee5a16a5-3438-4f2b-9341-5931b4cfe026&lang=en-us
- ↑ https://www.cyberciti.biz/faq/google-chrome-clear-or-flush-the-dns-cache/
About This Article
To flush your Windows computer’s DNS, start by clicking the Windows logo in the bottom left corner of your screen. Then, type “command prompt” into the search box, and select the Command Prompt app, which should be the top icon in the Start window. Next, enter "ipconfig /flushdns," and press Enter. Finish by restarting your web browser. For tips on how to flush your DNS on a Mac, read on!
Reader Success Stories
- "I believe it got rid of the errors. I still have to turn the computer off and start again."