Clear Windows DNS Cache

   Posted by David Kirk in Windows

Command to reset, flush or clear your DNS cache.

Vista, Windows 7, and WIndows 8

These same directions work in versions of Windows after XP; however, you’ll need to gain admin privileges first:
Vista, Windows 7, and Windows 8 directions for flushing the dns cache.

XP

XP remembers negative (DNS unable to resolve) entries for a few minutes. Often this can be a pain when moving and debugging sites. As long as that negative entry sits in your DNS cache, your box will continue to give you a cannot find server error. By cleaning out your DNS cache, you can fix this problem.

Rebooting will flush your cache… but there is an easier way.

Drop to a command box and type:

ipconfig /flushdns

If you wish to stop XP from placing negative entries into cache, you can make this change in your registry.

1. Goto HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Dnscache\Parameters
2. Build a new DWORD value called NegativeCacheTime and give it a value of 0

I believe the default time is 5 minutes. I always use zero for my default time, but I think the value above is in seconds. So if you only want to save them for 1 minute, then I am assuming you would change that value to 60.

 

About David Kirk

David Kirk is one of the original founders of tech-recipes and is currently serving as editor-in-chief. Not only has he been crafting tutorials for over ten years, but in his other life he also enjoys taking care of critically ill patients as an ICU physician.
View more articles by David Kirk

The Conversation

Follow the reactions below and share your own thoughts.

68 Responses to “Clear Windows DNS Cache”

  1. November 08, 2008 at 9:47 pm, big said:

    my bro the computer give me this

    Windows IP Configuration

    Could not flush the DNS Resolver Cache: Function failed during execution.

    Reply

    • November 09, 2008 at 2:35 am, JMal said:

      yah mine says the same thing and my internet explorer or mozilla firefox wont work. when i click on repair it stops at clearing the dns and says windows could not finish repairing the problem. Its wierd because my internet games that came with the computer like internet backgammon, checkers, hearts, reversi, and spades still connect to the internet and let me play against other people. WHAT DO I DO?

      Reply

      • January 10, 2011 at 2:54 pm, Ap_design said:

        You need to run as administrator. Right click cmd and run as adimn

        Reply

        • June 28, 2012 at 4:38 am, Georgia said:

          > OMG you saved my day, I don’t know who you are but I’m eternally greatful!!! Thank you thank you thank you!!!!!

          Reply

  2. November 08, 2008 at 9:48 pm, big said:

    pleace tell me what to do

    thanx 4 your help

    Reply

    • August 05, 2012 at 6:35 pm, Aaron said:

      > I also need to know what to do.
      Thanks you!

      Reply

  3. November 12, 2008 at 3:08 pm, Eric said:

    I have the same problem … When i run cmd under XP, and type ipconfig /flushdns

    i get an error : Could not flush the DNS Resolver Cache: Function Failed During Execution.

    Is there a way to fix this issue or will i have to perform a low-level format and re-up XP ?

    Reply

    • November 18, 2008 at 8:41 pm, obijon said:

      what you need to do is go here – http://support.microsoft.com/kb/919746
      the DNS service is not running on your pc, and you gotta start it up…

      Reply

      • June 23, 2009 at 1:12 am, Kumar said:

        Thanks alot my friend. this woks for me. great solution.

        Reply

      • September 25, 2010 at 6:15 pm, Stutommies6 said:

        Thanks, obijon! Cleared up my problem & I learned something new!!

        Reply

  4. January 13, 2009 at 7:33 pm, Josh Mc said:

    I have kind of a unique problem.

    a specific website (realclearpolitics) redirects to a different website owned by the same website. However, this problem only exists on my machine. when I contacted the system administrators for the website they informed me that only my machine was requesting that specific IP all others routed properly to the website. I am able,as a work around to visit the site by leaving off the “www.” so instead of http://www.realclearpolitics.com i address only realclearpolitcs.com.

    When I saw this entry I thought that perhaps this was the key. however I recieved a response of “The requested operation requires elevation.”

    Does anyone have any ideas?

    Reply

    • January 15, 2009 at 9:05 am, Vijay Nag said:

      Navigate to Control panel –>Administrative Tools –>services.(double click on services.). There you see a list of services and select the DNS Client. A separate window opens as Dns client properties. Then in the startup combo box select automatic and click on apply to make the changes.The most important part is to start the service by clicking on the start button. Then u get a status that the service is started .Try repairing it will work like a charm.

      Reply

      • February 15, 2009 at 7:36 am, nai said:

        Good comment
        Thank

        Reply

      • April 14, 2009 at 6:32 pm, Avery said:

        This works for me. Thanks!

        Reply

        • May 11, 2009 at 2:34 pm, daniel said:

          awesome help thanks!!

          Reply

      • November 01, 2009 at 3:32 pm, Inder said:

        Thanks You are a genius.
        May i request you to kindly advise me to resolve a problem which I am facing for a lomng time. i had some problem with my computer so i started recovery with help of CD (HP) 24 hour the progrmme continued.I stopped it and tried withcing on it did witch on then it started on a window showing that the programme is being loadedthen i have to put the system on standby then again to start after that it functions OK. may i request your advise

        Reply

      • July 30, 2010 at 9:32 pm, S. said:

        Great comment. Was having issues of my own, and this worked like a charm.. Thanks for taking the time… Cheers~ S.

        Reply

      • November 02, 2010 at 6:56 pm, Meinfenton said:

        Thank you so much for this information, it was driving me crazy not being able to connect to a wireless network, could only connect my laptop by using an ethernet cable.
        I will think of you every time I connect to the net THANK YOU.

        Reply

      • February 13, 2011 at 12:53 pm, Badboy Ctc said:

        THNXXX.. U ROCK…..

        Reply

      • June 16, 2011 at 12:10 pm, Anonymous said:

        Hello Mr. Helper,

        I want to contact you, can u plz mail me at prensoni0143@yahoo.com ?

        Reply

    • February 25, 2009 at 6:44 pm, Vijay Nag said:

      Try to clear the cookies.Probably that is doing the trick.To confirm once use another browser and check out if the same problem occurs.If not u ll have to clear cookies and take other options like changing ur IP address.

      Reply

    • December 28, 2009 at 2:18 am, ALLEN RICHARDS said:

      I’m no expert on the registry but I noticed(unless this was a typing error)there should have been a space between the word ipconfig and /and a space between the / and flushdns.

      Reply

    • April 27, 2011 at 7:28 am, Test said:

      no, sorry

      Reply

  5. January 19, 2009 at 2:04 pm, Omid said:

    Thanks Vijay :)
    Your solution is great .

    Reply

    • February 01, 2009 at 9:26 pm, Nico said:

      Thanks Vijay
      It works for me

      Reply

      • January 30, 2013 at 6:50 am, stuart hales said:

        I have a laptop running Vista and a desktop running XP.
        I have a router and network cable.
        The laptop can see the desktop and access files but the desktop can’t see the laptop.
        When repairing the local area connection I get cannot complete clearing the DNS cache.
        I click on run and enter ipconfig /flushdns and I get a quick flash of the dos screen – too quick to read anything but the DNS cache is not cleares.
        Pls advise nerxt step.

        Reply

  6. March 15, 2009 at 5:01 pm, Don said:

    When I run ipconfig/flushdns i grt a message Could not flush the DNS resolver cache:function failed during execution.
    What should I do to resolve this issue?

    Reply

  7. April 08, 2009 at 6:47 am, Manaji said:

    Hi Friends,
    how to clear dns cache & i am ping to any website BUt Not open any website
    Give me solution

    Reply

  8. April 21, 2009 at 1:43 pm, andra said:

    Thank’s man, the best solution about Clear DNS

    Reply

  9. April 29, 2009 at 10:40 pm, Sally Jane said:

    what is a command box? where is it?

    Reply

    • October 10, 2009 at 3:01 pm, Sam said:

      It is a DOS box.

      Reply

  10. April 29, 2009 at 10:42 pm, Sally Jane said:

    Okay the movie i bought on itunes will not download unless i flush this dns cache. How do i do it ?

    Reply

  11. May 14, 2009 at 6:16 am, Anonymous said:

    sir my computer give me this

    Windows IP Configuration

    Could not flush the DNS Resolver Cache: Function failed during execution.

    Reply

  12. May 17, 2009 at 4:41 am, SCWard said:

    What does “drop to a command box” mean?

    What is a “command box” ?

    How do you go about “dropping to” it ?

    This entry appears to be written in English, but makes no sense.

    How do i “goto HKEY_Local_ [etc] parameters “?
    Is that something i can do, if i “drop to ” a “command box” ?
    then, “Build a new DWORD value”, ….huh?

    If i were already a computer programmer, i would not be searching for help.

    Reply

    • May 18, 2009 at 4:08 pm, newbie said:

      Yes, it is all our fault that you don’t know how to get to a command line, and all programmers know everything and never need help too.

      Good points SCWard.

      Reply

      • June 03, 2009 at 7:09 pm, SC Ward said:

        actually quite simple, once you know;

        start/ run/ cmd/ ipconfig/ flushdns

        but in 20 posts, no one had offered that.

        Obviously, i found it elsewhere.

        Thanks so much for your useful input.

        Reply

    • June 10, 2009 at 2:39 pm, Goodomen said:

      Also, once your in there if you right click on a blank area in the right hand box you will get the option to create a new string, one of these is the DWORD

      Reply

  13. May 29, 2009 at 1:24 am, mehoe said:

    ipconfig /flushdns

    Reply

  14. June 05, 2009 at 5:38 pm, carol said:

    ipconfig/flushdns

    Reply

  15. July 02, 2009 at 2:44 am, carpet cleaning miami said:

    This will help a lot.. Thank for the output.. hope this will works..

    Reply

  16. July 05, 2009 at 1:56 am, help said:

    that still wont work and i got no idea about registery could use help

    Reply

  17. July 18, 2009 at 2:03 am, Anonymous said:

    I don’t get how to make a new string.
    Because once i clear the cache, the box disappears.
    Can someone give more details on how to do
    >> HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices DnscacheParameters
    -Sorry because i’m a noob

    Reply

  18. August 27, 2009 at 12:09 am, Anonymous said:

    i have an xp pc. when i run the command “ipconfig /flushdns” i get the error message “could not flush the dns resolver cache: function failed during execution”. suggestions? the problem at the root is i can’t get to a website i am building on my xp machine in either ie7 or firefox but can in either on my other pcs.

    Reply

  19. August 28, 2009 at 4:08 pm, Anonymous said:

    Sorry i could not understand can you discuss me in details

    Reply

  20. August 28, 2009 at 4:40 pm, Anonymous said:

    My window still not clearing DNS cache

    Reply

    • August 29, 2009 at 10:28 am, Anonymous said:

      i have a problem that is ..I m using ipconfig /flushdns but instead of having 26 dns server only one dns is pinging . nither i m not be able to ping my primary dns nor secondary dns. have uninstalled my NIC Driver but my problem is not solved

      Reply

  21. August 31, 2009 at 9:41 pm, Ray said:

    I ran the DOS command (ipconfig /flushdns) and now I can reach the internet via IE, but not via FireFox. I wonder if anyone has resolved this? Thanks very much for the help! Ray

    Reply

  22. January 07, 2010 at 10:47 pm, Anonymous said:

    flushdns

    Reply

  23. February 21, 2010 at 2:10 pm, Anonymous said:

    Great!!!!! Free advice!!!!!!!! which saved me a lot of tyme and $$$$$$$. You go men/women.

    Thanx,
    Kenknee

    Reply

  24. March 20, 2010 at 11:51 am, Anonymous said:

    if you cant access any website your pc got virus.
    try this

    START>>RUN>>TYPE cmd>>TYPE net stop dnscache

    try accessing the website you cant access now.

    to START dnscache in cmd prompt TYPE net start dnscache

    Reply

  25. March 21, 2010 at 9:25 am, Anonymous said:

    When I do searches in google.com or yahoo.com I get connection time out messages. I have no idea if it is a dns issue. I have tried the following and nothing has worked : (
    1. cleared cookies,temp files,etc.
    2. run mcafee security scan>>found no virus
    3. tried changing Google DNS server :
    http://code.google.com/speed/public-dns/docs/using.html
    >>didn’t work
    4. tried fixing host file (“fix it for me option”):
    http://support.microsoft.com/kb/972034
    >>I got the “connection timed out mssg”
    5.run ipconfig/flushdns

    Reply

  26. April 07, 2010 at 2:49 am, NuocHoa4U.com said:

    I tried but not success

    Reply

  27. April 07, 2010 at 8:40 am, Anonymous said:

    none of this stuff works – what then?

    Reply

  28. June 30, 2010 at 5:24 am, Taha said:

    Great Post Thx

    Reply

  29. July 01, 2010 at 12:32 am, Anonymous said:

    Thank you, worked perfectly!
    Regards from Thailand

    Reply

  30. July 30, 2010 at 10:24 pm, Rcavalier86 said:

    A simple way to clear your DNS cache is to download CCleaner and check the box DNS cache and that will take care of it. There are other utilities that do the same thing.

    Reply

    • October 11, 2010 at 1:44 am, Popoki Iti said:

      That’s what I did – it’s nice and easy which I love!

      Reply

      • October 12, 2010 at 1:07 am, Rcavalier86 said:

        Glad to be of service.

        Reply

  31. December 02, 2010 at 3:31 am, Android said:

    I have using the flushdns but it not working. Still same result.

    Reply

  32. May 03, 2011 at 5:07 am, Anonymous said:

    Work Great for me.Thanks David

    Reply

  33. June 28, 2011 at 7:59 am, houston carpet repair said:

    Loving your computer and upgrading it shows that it is really important and useful to you. It is same as the carpet. If your computer malfunctioned you make some repair, it is also the same as carpet.

    Reply

  34. April 01, 2012 at 2:51 am, Christian said:

    Can I stop Windows 7 from placing negative entries into cache? If so, how?

    I did what you said to do for XP using regedit. I have a 64-bit version of Windows 7 and the DWORD value is a 32-bit value. Would I make a DWORD and QWORD (64-bit) value? Or just QWORD? Or will the stopping of negative entries into cache even work at all for Windows 7?

    Thank You! =)

    Reply

  35. January 01, 2013 at 4:26 am, ASIK ALI S said:

    i have the detail explain for how to clear the ip address from cache…. plz send the detail.

    Reply

  36. January 30, 2013 at 6:56 am, stuart hales said:

    I tried using cmd.
    Then entered ipconfig /flushdns
    I got could not flush the dns resolver cache – function failed during execution

    Reply

  37. February 14, 2013 at 5:02 pm, stuart hales said:

    I tried ipconfig /flushdns in XP but I got a very brief screen flash and nothing happened. The screen was so quick I couldn’t reead anything

    Reply

  38. March 01, 2013 at 3:24 pm, DAVID said:

    AFTER TRING A DIFFERENT NETGEAR ROUTER THEN SWITCHING BACK TO THE FIRST ONE NOW MY WIRELESS PRINTER WONT CONNECT TO MY PC HELP

    Reply

  39. March 02, 2013 at 10:37 am, stuart hales said:

    I am running xp and ipconfig /flushdns doesn’t seem to work.

    I get a quick flash of a dos screen much to brief to read anything .

    Reply

  40. March 24, 2014 at 5:25 pm, Luci said:

    I’m having a problem with http://slotomania.yahoo.com, every time I’m redirected the website
    it then sends me to(tries to send me to) http://playerio.yahoo.com at which time I get “page can not be displayed” and to check the address. I’ve cleared my dns cache along with a ton of other things. Does ANYONE out there know how I can fix this or is it a Yahoo issue

    Reply

Leave a Reply