Configuring Windows DNS resolver cache
-
I http://stackoverflow.com/questions/630790/configuring-windows-dns-resolver-cache on Stack Overflow several months ago and didn't get any useful answers. Perhaps somebody here has better info. Note that I'm talking about the client DNS resolver cache. This message is not concerned with the Windows DNS Server. I have a C# program that does a lot of DNS resolutions. Because the HTTPWebRequest component won't let me change the Host header, I can't create my own internal DNS cache. So I have to depend on the Windows DNS cache, which doesn't appear amenable to change. There's a reasonably good http://technet2.microsoft.com/windowsserver/en/library/94d21089-411b-4bce-a823-49a77a46e7661033.mspx?mfr=true about the DNS cache Registry settings in Windows Server 2003, but I haven't been able to prove that setting them does anything in XP, Server 2003, Vista, or Server 2008. All the other pages I found through a Google search either reference that page or paraphrase it, sometimes incorrectly. Windows' ipconfig command has a /displaydns switch that will output the contents of the cache. To my knowledge, that's the only way to determine the size of the DNS cache. In my experiments on a 32 bit Windows XP box with 2 GB of memory, no matter what I set the DNS cache registry values to, I always end up with between 30 and 40 items in the cache--even after doing thousands of DNS resolutions. On my 64-bit Windows 2008 machine with 16 GB of memory, I always get between 270 and 300 items in the cache. I'm stumped. I don't know what the answer is, but I figure one of the following is the case: It's not possible to change the size of the DNS resolver cache. It is possible, but the documentation is wrong. The documentation is correct as far as it goes, but it’s incomplete. The documentation is correct and complete, but I’m too dumb to make sense of it. The documented registry entries actually changed the size of the cache, but ipconfig isn’t showing me all the entries that are in the cache. Can anybody tell me if it's possible to configure the size of the DNS resolver cache in Windows XP, Vista, or Server 2008?
-
Answer:
another way to verify would be to look at DNS traffic flowing on the wire. i.e. if your application makes a query for domainX at 2 PM and you don't see corresponding DNS packet at 2 PM in trace than that name got resolved using client side cache. I know, it is kind of convoluted way to confirm the cache size. I concur there should be better way to confirm this. Try shooting a question in Microsoft official forums or try sending a email to networking team here. http://blogs.msdn.com/wndp/
Jim Mischel at Server Fault Visit the source
Other answers
Give this a whirl: HKLM\System\CurrentControlSet\services\Dnscache\Parameters\MaxCacheSize I can't find any documentation for it, but the Dnscache service does check for the existence of that registry value when it starts up, so it's worth testing. The value is probably in kilobytes. Like I said, since it's undocumented, you'll have to test.
Ryan Ries
I haven't tried changing settings on the DNS Client so I can't speak into that, but what I suggest is to run processmon (www.sysinternals.com) while you're restarting the service. You should see any attempts that are made to read registry keys. It will tell you exactly which registry key and items it's trying to access. That should match up with the documentation, but if it doesn't it will hopefully tell you what's wrong.
Scott Forsyth - MVP
Related Q & A:
- How To Remove Burstly Image Cache?Best solution by android.net
- Is it possible to request Google and Bing/Yahoo to drop the cache of links they have indexed?Best solution by Webmasters
- is there a way to manage DNS without being a sysadmin?Best solution by Server Fault
- What is the different between internal DNS and external DNS?Best solution by answers.yahoo.com
- What is the Command to Minimize Windows Maximize Windows switch Windows close Windows without using the mouse?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.