瀏覽代碼

fix(nslord): increase serial when securing zone

Until now, we did not increase the serial when securing a zone,
assuming that the zone was not on any slaves (nsmaster) yet.
Instead, we have been making sure that slaving starts by switching
the zone type from NATIVE to MASTER after securing with DNSSEC.

With 67a3737a97ac8e6d4d0815e76dea7318e44bfad5, if we hurry to
update the domain IP before this script has run, nsmaster will be
notified, and we can end up with an unsecured zone on the slave.
Once this script runs, the zone will remain unsecured on the slave
until the serial happens to increase.

This commit avoids the issue by forcing a serial increase. (There
remains a time window during the first minute of domain existence
during which we may be serving unsecured IP records.)
Peter Thomassen 8 年之前
父節點
當前提交
62f085a905
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      nslord/cronhook/secure-zones.sh

+ 1 - 1
nslord/cronhook/secure-zones.sh

@@ -12,7 +12,7 @@ for ZONE in `echo "SELECT name FROM domains WHERE type = 'NATIVE' && id NOT IN(S
 	SALT=`head -c300 /dev/urandom | sha512sum | cut -b 1-16`
 	SALT=`head -c300 /dev/urandom | sha512sum | cut -b 1-16`
 
 
 	# Set up DNSSEC and switch zone type to MASTER
 	# Set up DNSSEC and switch zone type to MASTER
-	pdnsutil secure-zone $ZONE && pdnsutil set-nsec3 $ZONE "1 0 300 $SALT" && pdnsutil set-kind $ZONE MASTER
+	pdnsutil secure-zone $ZONE && pdnsutil set-nsec3 $ZONE "1 0 300 $SALT" && pdnsutil set-kind $ZONE MASTER && pdnsutil increase-serial $ZONE
 
 
 	# Take care of delegations
 	# Take care of delegations
 	if [ "$PARENT" == "dedyn.io" ]; then
 	if [ "$PARENT" == "dedyn.io" ]; then