' €-record we need to replace ("old" record)
Const FIND_A_RECORD = "1.2.3.4"
' IP address of your primary DNS server
Const PRIMARY_DNS_IP = "10.11.12.13"

Set C = CreateObject("SDNSAPI.Connection")
C.Init "127.0.0.1",8053,""
Set L = C.GetZoneList()

for each O in L
   if O.Secondary then
      Set zone = C.GetZone(O.ZoneName)
      k = zone.Records.IndexOf("www." & O.ZoneName, "A", FIND_A_RECORD)
      if k <> -1 then
         WScript.Echo "FOUND ZONE: " & zone.Name

             C.RemoveZone(O.ZoneName)
             WScript.Echo "Removed: " & O.ZoneName         

             Set Z = C.CreateZone(O.ZoneName, "ns1.testzone.com", "hostmaster@testzone.com")
                 Z.PrimaryIP = PRIMARY_DNS_IP
             C.UpdateZone(Z)
             Set Z = Nothing

             WScript.Echo "Created secondary zone: " & O.ZoneName
      end if
      Set zone = Nothing
   end if
next