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 220.127.116.11 to something else. And your primary DNS IP address is 18.104.22.168. In this case FIND_A_RECORD = “22.214.171.124” and PRIMARY_DNS_IP = “126.96.36.199”
Download the script.
‘ А-record we need to replace (“old” record)
Const FIND_A_RECORD = “188.8.131.52”
‘ IP address of your primary DNS server
Const PRIMARY_DNS_IP = “10.11.12.13”
Set C = CreateObject(“SDNSAPI.Connection”)
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, “ns1.testzone.com”, “email@example.com”)
Z.PrimaryIP = PRIMARY_DNS_IP
Set Z = Nothing
WScript.Echo “Created secondary zone: ” & O.ZoneName
Set zone = Nothing