Clear Windows DNS Cache

Contributor Icon Contributed by davak Date Icon November 27, 2003  
Tag Icon Tagged: Windows

Command to reset, flush or clear your DNS cache.


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

Vista requires special directions for flushing the vista dns cache.

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.

Previous recipe | Next recipe |
 
  • big
    my bro the computer give me this

    Windows IP Configuration

    Could not flush the DNS Resolver Cache: Function failed during execution.
  • JMal
    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?
  • big
    pleace tell me what to do

    thanx 4 your help
  • Eric
    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 ?
  • obijon
    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...
  • Kumar
    Thanks alot my friend. this woks for me. great solution.
  • Josh Mc
    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 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?
  • Vijay Nag
    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.
  • nai
    Good comment
    Thank
  • Avery
    This works for me. Thanks!
  • daniel
    awesome help thanks!!
  • Inder
    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
  • Vijay Nag
    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.
  • Omid
    Thanks Vijay :)
    Your solution is great .
  • Nico
    Thanks Vijay
    It works for me
  • Don
    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?
  • Manaji
    Hi Friends,
    how to clear dns cache & i am ping to any website BUt Not open any website
    Give me solution
  • Thank's man, the best solution about Clear DNS
  • Sally Jane
    what is a command box? where is it?
  • Sam
    It is a DOS box.
  • Sally Jane
    Okay the movie i bought on itunes will not download unless i flush this dns cache. How do i do it ?
  • shareef
    sir my computer give me this

    Windows IP Configuration

    Could not flush the DNS Resolver Cache: Function failed during execution.
  • SCWard
    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.
  • newbie
    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.
  • SC Ward
    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.
  • Goodomen
    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
  • mehoe
    ipconfig /flushdns
  • carol
    ipconfig/flushdns
  • This will help a lot.. Thank for the output.. hope this will works..
  • help
    that still wont work and i got no idea about registery could use help
  • lotters
    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_MACHINE\SYSTEM\CurrentControlSet\Services\ Dnscache\Parameters
    -Sorry because i'm a noob
  • paulzy
    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.
  • pnkjsehgal
    Sorry i could not understand can you discuss me in details
  • pnkjsehgal
    My window still not clearing DNS cache
  • Biswa
    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
  • Ray
    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
blog comments powered by Disqus