For DNS Resolution testing purposes... I want to disable all DNS caches in my Windows 7
Still I keep seeing "DNS Lookup : 0 ms"
for consecutive requests of the same domain.
I've tried the obvious "ipconfig /flushdns"
, and also stopping totally the service:
net stop dnscache
also this command makes the same effect:
net stop "DNS Client"
and also I know Browser are caching DNS Lookups for very short time. So I flush their caches, close-open the browser, or I open the same domain in different browsers (Firefox, chrome, chrome incognito, IE ) to bypass that DNS Cache.
So the first time, DNS Lookup time can be 25ms (using 8.8.8.8) but then the next DNS Lookup is cached somewhere in the system and time is 0ms. And only goes away if I wait around 3 to 5 minutes to repeat the request.
What can I do to force the system to resolve the DNS every single time, even it's 5 seconds between the same DNS request ?
Has anything to do with keep-alive or some kind of re-use of TCP connections by Windows ? It shouldn't, because I re-open the browser. But I'm out of ideas,
Could you shed some light on this issue?
Thank you
It sounds like your goal is to simulate a non-existent configuration that doesn't exist in the wild (since all clients have DNS caches). It's not entirely clear why that's an interesting configuration to test, but it is possible to do so.
As you mentioned, all browsers have DNS caches. Windows' DNS client itself has a cache. Any upstream proxy you might be using also has a DNS cache.
In this case, you are hitting two problems: First, Fiddler itself maintains a DNS cache. Second, Fiddler pools keep-alive connections to the server, regardless of whether you close your browser client or not.
As described in the Fiddler book, you can control the Fiddler DNS cache using the preference fiddler.network.timeouts.dnscache
. The default value is 150000
(measured in milliseconds, so that's 2.5 minutes). You can set this value to 0
to prevent DNS caching.
In order to prevent reuse of connections, you can either hit CTRL+X in the Fiddler session list, or call the FiddlerApplication.oProxy.PurgeServerPipePool
method as desired.