I am on a Windows XP Home machine.

Go through the scheduled task wizard, point to .../system32/ipconfig.exe, tack on /flushdns in the advanced properties, set to run everyday. (with possibility of higher frequency in mind)

Pros? Cons?

add a comment

5 Answers

  • Votes
  • Oldest
  • Latest

I don't understand the point in doing this, Joebert. The Time To Live (TTL) by default is 24 hours at which point if the resolver cache is not updated prior, it will expire from cache at that time. For negative hits (basically times when a server may be down or not responding, etc) that time is only 5 minutes.

Virtually there's no need to flush your DNS on a daily basis. If you feel those times are longer than you'd like, you can modify your registry to shorten them. The Registry key that is involved is:


The binary entry MaxCacheEntryTtlLimit can change how long DNS entries are cached. In the absence of this entry the default is 86400 seconds (one day), so if you wish to shorten it add the entry with the time in seconds that you would prefer. This page explains how, and adds more detailed information than what I just gave.

As a side note, you can see what's in your resolver cache at any time by typing ipconfig /displaydns

add a comment

I don't really see a need for this at all. Is there a reason why you need to flush your DNS cache everday or more?

I see no Pro's or Con's for doing this.

  • 0
    Because it's frequently filled with listings for advertisement sites, signature image sites, ect. — joebert
add a comment

This is going to actually slow your internet connection down. The whole idea of a local DNS cache is to speed up your connection by keeping you from having to ask your DNS server to resolve the URL everytime you visit a website.

  • 0
    Good point, didn't even think about it. The only time I do that is when troubleshooting. — grinch2171
add a comment

I notice the contents of the hosts file is used when populating the DNS, I'm aware of huge host files actually slowing down performance & now I'm thinking about mapping frequently visited sites in the hosts file rather than filling it with loopbacks & reducing the TTL in the registry to one hour while flushing DNS every hour.

As long as I remember to remove entries from the hosts file long enough to get a resolve if addresses change I think I'd be alright, then again, that could open me up to a world of hurt if someone crafted a mockup & happened to get a previous IP address of one of thees sites. 😕 Though I think that chance is slim.

Any thoughts on that one guys ?

add a comment

I do this on a scheduled task. It's actually a great idea, in my opinion. DNS cache can be a real problem. That's why there's a /flushdns switch. I've found, through solid troubleshooting, that clearing this can improve things.

So, I run it as a Scheduled Task once a day. I also clear my pfSense cache if my Internet slows down. Don't really need a retort, but the OP is looking for how to do it, not people's opinion if its a good idea. Because some of the justification isn't completely accurate. Why? Because if you want to clear your cache, there's a lot of reasons to do it.

I can't tell if running a command switch is working, so I make a .bat on a schedule.

  1. Make a text file with this text, save, and rename .bat.

    c:\windows\system32\ipconfig.exe /flushdns
  2. If you don't want to see the command prompt remove the word pause.

  3. Open Task Scheduler. Create New Basic Task. On the actions page, start a program, Browse to your script.

Done. Enjoy! Let other people have bad cache and think DNS is magic and takes care of itself. My system can rebuild cache pretty quick. Plus, how many sites do you visit in one day that you'll never need their cached entries? Most of the sites I visit everyday.

add a comment