Disappearing DNS Community Fix

I mentioned the problem that a number of people are having with the latest DNS MP in  a previous post. Apparently Microsoft are aware of the bug but they can not repro it. Without being able to reproduce it they are having a problem fixing it. However Daniele Grandini contacted me with a fix that he has created. In his environment his DNS servers went from 38 to 53 after applying his fix and they have not disappeared since.

He says

The discovery script has a bug when the WMI query fails, in this case it will return an empty discovery document, this in turn will delete the previous discovery. This explains the flip flop behaviour with disappearing and reappearing DNS Servers. It must be added that the discovery runs every 15 mins making this more visible.

The repro is actually quite easy, if the following line fails the discovery returns an empty discovery document:
Set colServers = ExecuteWMIQuery(“Select * from MicrosoftDNS_Server”)

On one side is a WMI related issue (DNS provider?) on the other side the script doesn’t test for an error. To simulate such an error just enter an error in the line above, like:
Set colServers = ExecuteWMIQuery(“Select * from MicrosoftDNS_Server123”)

My mod is as least invasive as I can, at the end of the main routine I just checked for an error and in that case I won’t return any discovery data, it was:
                Call objAPI.Return(objDiscoveryData)
                Trace “Exiting normally”
Now it is:
If Err.Number <> 0 Then
    trace “Unable to CreateDiscoveryData.”
    wscript.Quit
else
                Call objAPI.Return(objDiscoveryData)
                Trace “Exiting normally”
end if

 

I have not had a chance to test this MP myself yet as I have not been back to the customer where I installed (and then uninstalled) the latest DNS MP. However it is worth a look in a test environment for all the people having this issue.

Here is the MP: – microsoftwindowsdnsserver2003fixxml – remove the .doc ending (needed to get it to upload) to get the XML file.

Advertisements
%d bloggers like this: