Clear Windows DNS Cache

Contributor Icon Contributed by David Kirk     
Tag Icon Tagged: 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.

 

58 Comments -


  1. big said on November 8, 2008

    my bro the computer give me this

    Windows IP Configuration

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

  2. big said on November 8, 2008

    pleace tell me what to do

    thanx 4 your help

  3. JMal said on November 9, 2008

    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?

  4. Eric said on November 12, 2008

    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 ?

  5. obijon said on November 18, 2008

    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…

  6. Josh Mc said on January 13, 2009

    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?

  7. Vijay Nag said on January 15, 2009

    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.

  8. Omid said on January 19, 2009

    Thanks Vijay :)
    Your solution is great .

  9. Nico said on February 1, 2009

    Thanks Vijay
    It works for me

  10. nai said on February 15, 2009

    Good comment
    Thank

  11. Vijay Nag said on February 25, 2009

    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.

  12. Don said on March 15, 2009

    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?

  13. Manaji said on April 8, 2009

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

  14. Avery said on April 14, 2009

    This works for me. Thanks!

  15. andra said on April 21, 2009

    Thank’s man, the best solution about Clear DNS

  16. Sally Jane said on April 29, 2009

    what is a command box? where is it?

  17. Sally Jane said on April 29, 2009

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

  18. daniel said on May 11, 2009

    awesome help thanks!!

  19. Anonymous said on May 14, 2009

    sir my computer give me this

    Windows IP Configuration

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

  20. SCWard said on May 17, 2009

    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.

  21. newbie said on May 18, 2009

    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.

  22. mehoe said on May 29, 2009

    ipconfig /flushdns

  23. SC Ward said on June 3, 2009

    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.

  24. carol said on June 5, 2009

    ipconfig/flushdns

  25. Goodomen said on June 10, 2009

    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

  26. Kumar said on June 23, 2009

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

  27. carpet cleaning miami said on July 2, 2009

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

  28. help said on July 5, 2009

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

  29. Anonymous said on July 18, 2009

    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

  30. Anonymous said on August 27, 2009

    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.

  31. Anonymous said on August 28, 2009

    Sorry i could not understand can you discuss me in details

  32. Anonymous said on August 28, 2009

    My window still not clearing DNS cache

  33. Anonymous said on August 29, 2009

    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

  34. Ray said on August 31, 2009

    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

  35. Sam said on October 10, 2009

    It is a DOS box.

  36. Inder said on November 1, 2009

    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

  37. ALLEN RICHARDS said on December 28, 2009

    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.

  38. Anonymous said on January 7, 2010

    flushdns

  39. Anonymous said on February 21, 2010

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

    Thanx,
    Kenknee

  40. Anonymous said on March 20, 2010

    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

  41. Anonymous said on March 21, 2010

    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

  42. NuocHoa4U.com said on April 7, 2010

    I tried but not success

  43. Anonymous said on April 7, 2010

    none of this stuff works – what then?

  44. Taha said on June 30, 2010

    Great Post Thx

  45. Anonymous said on July 1, 2010

    Thank you, worked perfectly!
    Regards from Thailand

  46. S. said on July 30, 2010

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

  47. Rcavalier86 said on July 30, 2010

    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.

  48. Stutommies6 said on September 25, 2010

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

  49. Popoki Iti said on October 11, 2010

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

  50. Rcavalier86 said on October 12, 2010

    Glad to be of service.

  51. Meinfenton said on November 2, 2010

    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.

  52. Android said on December 2, 2010

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

  53. Ap_design said on January 10, 2011

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

  54. Badboy Ctc said on February 13, 2011

    THNXXX.. U ROCK…..

  55. Test said on April 27, 2011

    no, sorry

  56. Anonymous said on May 3, 2011

    Work Great for me.Thanks David

  57. Anonymous said on June 16, 2011

    Hello Mr. Helper,

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

  58. houston carpet repair said on June 28, 2011

    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.

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -