Are there any differences for DNS caching between Windows-7 and Windows-XP?
I need to write some code that will query the local DNS cache on a Windows machine so I am using DnsQuery with option DNS_QUERY_NO_WIRE_QUERY like so: status = DnsQuery(hostName, DNS_TYPE_A, DNS_QUERY_NO_WIRE_QUERY, NULL, &pDnsRecord, NULL); This returns a status of zero and a DNS record set if successful. On XP, I can add an entry to the cache by pinging a host and then see the result using the command line using ipconfig /displaydns and my code returns the same result. Windows-7 is a different matter - even if an entry is in the cache, the API call will not return it. If the API call is made without the restriction of only checking the cache then it returns the item and adds it to the cache where it will be found by the next cache-only API call. Does this seem correct? MSDN does not indicate any changes to the API for Windows-7.
December 22nd, 2010 12:32pm

For source code related questions, please discuss in our MSDN forum. Windows Developer Center > Windows: General ForumsPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
December 24th, 2010 1:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics