Simple DNS script

For some weird reason secondary Simple DNS server waits too long sometimes to update DNS records changed on primary DNS server. Especially if lots of records were changed in a short time.

It takes too much time to reload all the records manually in such cases. So we recommend to run the following script on your secondary Simple DNS server. The script forces the server to make the secondary zones update.

The script is created, tested and used many times by our team and our friends. And we feel the need to share it with our website community. Use it and enjoy!

You just need to change FIND_A_RECORD and PRIMARY_DNS_IP constants in this script and run it.

Let’s say you have changed multiple A records on your primary DNS server and changed their IP address from to something else. And your primary DNS IP address is In this case FIND_A_RECORD = “” and PRIMARY_DNS_IP = “”

Download the script.

‘ А-record we need to replace (“old” record)
Const FIND_A_RECORD = “”
‘ IP address of your primary DNS server

Set C = CreateObject(“SDNSAPI.Connection”)
C.Init “”,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

WScript.Echo “Removed: ” & O.ZoneName

Set Z = C.CreateZone(O.ZoneName, “”, “”)
Set Z = Nothing

WScript.Echo “Created secondary zone: ” & O.ZoneName
end if
Set zone = Nothing
end if