I need something that will scan all A records on my DNS server and then identify which IP addresses are used more than once. I am trying to cleanup DNS so that there are NO multiple A-Records for a single IP and use CNAME's instead.
I can query the info from DNS fine, but I am thinking that I will need to use something like a dictionary to find the duplicates. Unfortunately, I am not well versed in the dictionary object. Here is what I have that I am using the query my DNS server:
Any ideas?
I can query the info from DNS fine, but I am thinking that I will need to use something like a dictionary to find the duplicates. Unfortunately, I am not well versed in the dictionary object. Here is what I have that I am using the query my DNS server:
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\MicrosoftDNS")
Set colItems = objWMIService.ExecQuery("Select * from MicrosoftDNS_AType")
For Each objItem in colItems
If objItem.DomainName = "domain.net" Then
wscript.echo objItem.IPAddress & ";" & objItem.OwnerName
End If
Next
Any ideas?