How to clear/flush the DNS cache in Google Chrome?

983,987

Solution 1

Navigate to chrome://net-internals/#dns and press the "Clear host cache" button.

Solution 2

Sometimes you need to flush the socket pools after flushing the DNS:

chrome://net-internals/#sockets

Solution 3

"Navigate to chrome://net-internals/#dns" doesn't work in the Google Chrome browser, at least on my system. Looks like this solution maybe works for the Google Chrome OS, but not the Google Chrome browser more generally speaking. For me the link redirects here:
The Chromium Projects

It appears "Empty the Cache" is the better solution. Also note my browser says "Preferences" rather than "Options"

Via http://www.google.com/support/forum/p/Chrome/thread?tid=026b6a1d9151a6e3&hl=en

"Go to tools -> options -> Under the hood -> Clear Browsing data and check 'empty the cache' and click on clear browsing data. Yes yes, I know, it is not the DNS cache I would expect it to clear, but hey it seems to. And now it works for me."

Solution 4

Clicking "clear host cache" in chrome://net-internals/#dns should do it for Google Chrome, but there are other DNS caches to consider on your machine.

Windows:

ipconfig /flushdns

OS X pre-10.7 (before Lion):

sudo dscacheutil -flushcache

OS X 10.7–10.9 (Lion, Mountain Lion, Mavericks):

sudo killall -HUP mDNSResponder

OS X 10.10+ (Yosemite):

sudo discoveryutil mdnsflushcache

OS X 10.11, 10.12+ (El Capitan, Sierra):

sudo killall -HUP mDNSResponder

Your router may be caching the DNS as well (restart it or read the manual). The ultimate test is to use dig, but this uses your network's DNS host, not the authoritative server by default:

dig superuser.com

To query right from the source, try something like:

dig superuser.com @ns1.serverfault.com

Solution 5

In OS X 10.9.1 w/ Chrome 32 I needed to both clear the host cache and flush the socket pools to get Chrome to refresh the DNS cache:

  1. Navigate to chrome://net-internals/#dns and click "Clear Host Cache"
  2. Navigate to chrome://net-internals/#sockets abd click "Flush Socket Pools"
Share:
983,987

Related videos on Youtube

Mee
Author by

Mee

Updated on September 17, 2022

Comments

  • Mee
    Mee almost 2 years

    As you probably know Google Chrome has its own internal DNS cache. Is there a way to clear it without having to wait for the time out or close the browser?

    • Nolonar
      Nolonar about 11 years
      The only reason for me to flush Chrome's DNS cache is because if I don't, I can't access Google. Luckily, Google's not the only search engine out there (or else I wouldn't have found this question) and I only have to deal with Chrome at work.
    • Ketil
      Ketil over 10 years
      For me, this is probably caused by having an incorrect DNS-server in resolv.conf. (I am trying to access an internal server on a VPN). The people at T-com have misconfigured their DNS to respond with their advertisement site instead of NXDOMAIN, and the people who wrote Chrome didn't care to respect the resolv.conf order, but instead happily use whatever DNS server appears to work.
    • Nathan Long
      Nathan Long about 10 years
  • Mee
    Mee over 13 years
    Strangely, this only works in one direction. I have a mapping in the hosts file that maps a domain name to the local machine (i.e. to 127.0.0.1), when I remove the mapping and flush the DNS cache in Chrome, it correctly loads the site from the internet, but when I add the mapping again to the hosts file, it still loads the site from the internet. It shows the cached DNS list empty in Chrome after clearing the DNS cache (also cleared the OS cache using ipconfig /flushdns), still, it loads the site from the internet! Seems like a bug.
  • Mee
    Mee over 13 years
    Even more annoying, Chrome shows the IP address correctly (127.0.0.1) for that domain in the DNS cache list (after flushing and trying to load the site again), still it loads the site from the internet.
  • Ian
    Ian about 13 years
    awesome, is there a list of all the chrome://* options anyway does anyone know?
  • pxl
    pxl almost 13 years
    @Ian chrome://about
  • chakrit
    chakrit over 12 years
    For copy and paste into address bar: chrome://net-internals/#dns
  • andrew cooke
    andrew cooke over 12 years
    this does not work for all addresses. the answer given below (preferences; clear browsing data) does. due to the strange way my cable modem powers up chrome had cached the dns for my isp as "news.bbc.co.uk" (the modem sends you to the isp before it's fully up). following the above did not remove it. going via the preferences did.
  • minamhere
    minamhere about 12 years
    This seems to work to force Chrome to recognize changes to the hosts file.
  • TrickyDBA
    TrickyDBA over 11 years
    @Mee Restarting System's "DNS Client" Service from Services.msc might help.
  • Air
    Air over 11 years
    Interesting note: if you have clicked the 'Stop' button in the red title bar, the 'Clear host cache' button will disappear. In any case this approach does not appear to actually clear the DNS cache.
  • Air
    Air over 11 years
    Confirmed this worked for me, Clear Browsing Data -> Empty the cache. No other method worked. Thanks PJ.
  • Rob Osborne
    Rob Osborne over 11 years
    This seems to only work sometimes when you have multiple user profiles. Chrome is almost the perfect developers browser except for bugs like this.
  • andrewtweber
    andrewtweber about 11 years
    Same problem here. I have tried clearing cache, clearing the internal DNS cache, ipconfig flush dns, and it is still loading a local website from the live domain. If I open it in "Incognito" it works, or in Firefox it works, but normal Chrome refuses to reset its DNS
  • Martin Argerami
    Martin Argerami almost 11 years
    This didn't work for me. Emptying the cache (as the second answer suggests) did.
  • chovy
    chovy almost 11 years
    This worked for me on both chrome and chromium when /etc/resolver/foo.com was being ignored.
  • Paul Draper
    Paul Draper over 10 years
    This worked...except when I went to incognito. I just couldn't figure out why that wasn't working.
  • DocSalvager
    DocSalvager over 10 years
    Looks like Google is gradually making name changes to some internal URLs over different versions. As of version 27.0.1421.0 (184274)...
  • daboross
    daboross over 10 years
    Doing this and then going to the website and pressing shift+f5 3 times worked for me! Didn't work without using shift+f5 3 times though.
  • Canadian Luke
    Canadian Luke over 10 years
    Hi Bart, welcome to Superuser! Unfortunately, this question is about the computer-version of Chrome, not the mobile version. I'd suggest editing your answer to reflect the desktop version. Thanks
  • Markus Amalthea Magnuson
    Markus Amalthea Magnuson over 10 years
    This worked for me on Mac Chrome, after having tried the chrome://net-internals/#dns flush trick mentioned here, without success.
  • MaxPower
    MaxPower about 10 years
    At least clearing Cached images and files did not work for me (Chromium 33 on Ubuntu) after turning on OpenVPN and thus switching my active DNS server. (Clear host cache as in the popular answer did not work either.) So far I have not found anything that works except restarting the browser, or entering the IP address in the URL.
  • Adam Tal
    Adam Tal about 10 years
    Wasn't enough for me. Had to "ipconfig /flushdns" in command prompt (found in answer below)
  • blueintegral
    blueintegral almost 10 years
    I needed it in Windows 8.1 as well, so it's not just OS X.
  • pengemizt
    pengemizt over 9 years
    Chrome for Linux also need it chrome://net-internals/#sockets
  • Bing
    Bing over 9 years
    Clearing Cached images and files worked for me! No clue why, but it did. Windows 8.1, Chrome 41.0.2272.89 m
  • Pacerier
    Pacerier about 9 years
    Note that Chrome now monitors the hosts file and autoclears the dnscache whenever there are any changes to the hosts file. —You can easily test if that works on your system by adding a blank line after your hosts file, and the list at chrome://net-internals/#dns will be autoupdated.— Windows' dnscache service will also (at least on win 8.1) monitor the hosts file for changes, so after you have updated your hosts file, simply clicking on the button "Flush socket pools" will work. Nothing else is needed.
  • Pacerier
    Pacerier about 9 years
    Refreshing will not help one bit. The active TCP sockets will still be active. You either wait it out (1-2 minutes) or manually flush them.
  • Pacerier
    Pacerier almost 9 years
    Just tested on Server 2003 too. Whenever there are any changes to the hosts file, dnscache service automatically reloads the cache without any need for ipconfig /flushdns nonsense. ipconfig /flushdns seems to be a red herring in this entire issue.
  • Pacerier
    Pacerier almost 9 years
    @AdamTal, Actually if you update your hosts file, the dns cache service will reload itself. See superuser.com/questions/203674/… for more info.
  • bertieb
    bertieb almost 9 years
    Hi Boreas320, can you provide a summary of what your link provides in your answer in case it becomes out of date? Answers that are only/mostly a link are discouraged as they can go stale.
  • Rob Scott
    Rob Scott over 8 years
    Worked for me, even after flushing dns in cmd and doing the accepted answer
  • Elijah Lynn
    Elijah Lynn over 8 years
    Chrome for Linux just needs a socket flush. No DNS flush. superuser.com/a/611712/30982
  • Elijah Lynn
    Elijah Lynn over 8 years
    This does not work on Chrome for linux. But just a socket flush works. superuser.com/a/611712/30982
  • Elijah Lynn
    Elijah Lynn over 8 years
    Awesome, this is the only solution that works on Chrome for Linux (Ubuntu 14.04). In fact a DNS flush doesn't affect anything. All that is needed is to do a socket flush. I consider this a bug.
  • Elijah Lynn
    Elijah Lynn over 8 years
    Just went to report a bug and did a search... already exists. Please star/follow this bug report => code.google.com/p/chromium/issues/detail?id=268059
  • Ezra
    Ezra over 7 years
    "sudo discoveryutil mdnsflushcache" didn't work on El Capitan (10.11) for me, but "sudo killall -HUP mDNSResponder" did, it said that discoveryutil did not exist, maybe it's Sierra and up?
  • i_a
    i_a about 7 years
    Up! Wonderful idea! Thanks! However it didn't work for me until I replaced the javascript with document.getElementById('sockets-view-flush-button').click()‌​;
  • Hippyjim
    Hippyjim over 6 years
    No longer works.
  • Bojan Hrnkas
    Bojan Hrnkas over 6 years
    @Hippyjim, it never worked alone. You also have to clear DNS (chrome://net-internals/#dns). My answer is only usefull when clearing DNS alone doesn't work.
  • Hippyjim
    Hippyjim over 6 years
    Yeah, I did both. Still nothing. Thanks anyway. I'm working around it by using an Incognito window - which makes absolutely no sense!
  • byronyasgur
    byronyasgur about 6 years
    clearing cached images and files worked for me too - nothing else did
  • Tatsh
    Tatsh almost 6 years
    Now I wish for a way to do this on command line along with my other stuff to flush DNS cache.
  • Sharak
    Sharak over 5 years
    On Firefox my local page works just fine. On Chrome it still loads online resource. And I've tried every single answer here. This is just ridculous! Because of the MANY things like this one I like Firefox better. Chrome is bad for my health!
  • jmgarnier
    jmgarnier about 5 years
    extension no longer exists
  • Nickolay Kondratenko
    Nickolay Kondratenko almost 5 years
    It works, thank you. Just want to add that also need to restart the browser.
  • Albert Renshaw
    Albert Renshaw over 4 years
    This worked for me when the DNS flush didn't, 2019 -- Chrome Version 77.0.3865.120
  • Cédric Françoys
    Cédric Françoys over 4 years
    Windows 10, Chrome 79+ : chrome://settings/clearBrowserData : General tab, tick Images and Files checkbox. Done.
  • sope
    sope about 4 years
    not working for me at Version 80.0.3987.163 (Official Build) (64-bit)
  • ShreevatsaR
    ShreevatsaR about 4 years
    I also had to kill service workers: chrome://inspect/#service-workers and click "terminate" (also double-check in chrome://serviceworker-internals/)
  • Hay
    Hay almost 4 years
    Clearing the browser cache is the only thing that works for me, even after waiting for a 15 minutes or so... Thanks!
  • Michael Liquori
    Michael Liquori about 3 years
    the internals link works fine for me, but doesn't fix the problem. Clearing the cache does, thanks!
  • vaughan
    vaughan almost 3 years
    Incognito tab worked for me.
  • avia
    avia over 2 years
    @jmgarnier it actually does.
  • avia
    avia over 2 years
    EDIT: For those still struggling (?) I ended up changing my DNS reseolver all simply and entirely to 8.8.8.8. Well, I can't post an answer to recap my situation so I'll post here. After trying a combination of all answers below (incl. the plugin), I still can't resolve a simple .com domain in Chrome (!!). Resolves fine in Firfox or else. Even restarted my system twice.
  • ssppjj
    ssppjj over 2 years
    This finally fixed my problem and I can start hitting the new address.
  • ssppjj
    ssppjj over 2 years
    This is not enough for me. I had to hit chrome://net-internals/#sockets as well.
  • Admin
    Admin about 2 years
    Not Working in chrome 101.0.4951.67
  • Admin
    Admin almost 2 years
    this solution is not working for me. chrome still not load site