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 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.

  • 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?

      • Ap_design

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

        • Georgia

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

  • big

    pleace tell me what to do

    thanx 4 your help

    • Aaron

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

  • 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 –
      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.

      • Stutommies6

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

  • 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 i address only

    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

      • 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

      • S.

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

      • Meinfenton

        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.

      • Badboy Ctc

        THNXXX.. U ROCK…..

      • Anonymous

        Hello Mr. Helper,

        I want to contact you, can u plz mail me at ?

    • 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.


      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.

    • Test

      no, sorry

  • Omid

    Thanks Vijay 🙂
    Your solution is great .

    • Nico

      Thanks Vijay
      It works for me

      • stuart hales

        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.

  • 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 ?

  • Anonymous

    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


  • carpet cleaning miami

    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

  • Anonymous

    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

  • Anonymous

    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.

  • Anonymous

    Sorry i could not understand can you discuss me in details

  • Anonymous

    My window still not clearing DNS cache

    • Anonymous

      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

  • Anonymous


  • Anonymous

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


  • Anonymous

    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

  • Anonymous

    When I do searches in or 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 :
    >>didn’t work
    4. tried fixing host file (“fix it for me option”):
    >>I got the “connection timed out mssg” ipconfig/flushdns

  • I tried but not success

  • Anonymous

    none of this stuff works – what then?

  • Taha

    Great Post Thx

  • Anonymous

    Thank you, worked perfectly!
    Regards from Thailand

  • Rcavalier86

    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.

    • Popoki Iti

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

      • Rcavalier86

        Glad to be of service.

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

  • Anonymous

    Work Great for me.Thanks David

  • 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.

  • 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! =)


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

  • stuart hales

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

  • stuart hales

    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



  • stuart hales

    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 .

  • Luci

    I’m having a problem with, every time I’m redirected the website
    it then sends me to(tries to send me to) 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