DnsQuery_W for SRV record fails even though nslookup can see the record RRS feed

  • Question

  • I have a C# application that calls through to DnsQuery_W from dnsapi using p/invoke, in order to do an SRV record lookup.

    On Windows 7 (not on XP), when running a test under mstest, this code fails with a 9003 error (can't find the record).  If I run nslookup to do a manual lookup, I can see that the record is there.  Once the system gets into this state, it will continue to fail until I do an ipconfig /flushdns

    The really odd thing is that this only seems to happen when running tests via mstest.  I've never seen this problem in the full application or even when running the same test in Visual Studio.

    I was wondering if anyone had ever seen a problem like this before, or might know what could be putting my system in this state (something funny with mstest? Windows 7's DNS caching? ... ?)

    Monday, June 18, 2012 7:37 PM

All replies