Explorar el Código

Fix: Set default SOA retry value to 1800 for DENIC compliance (#5030)

* Fix: Set default SOA retry value to 1800 for DENIC compliance

    Uses 1800 seconds for .de, .cz, .pl, .pt (required by registry rules)

    Uses 3600 seconds for all others, including .fr, .be, etc.

This ensures better compatibility with strict registries while keeping defaults for common domains.

-- Fixed formatting
Giusemx hace 8 meses
padre
commit
91bdc66ccd
Se han modificado 1 ficheros con 16 adiciones y 3 borrados
  1. 16 3
      func/domain.sh

+ 16 - 3
func/domain.sh

@@ -495,19 +495,32 @@ update_domain_zone() {
 		SERIAL=$(date +'%Y%m%d01')
 		SERIAL=$(date +'%Y%m%d01')
 	fi
 	fi
 	if [[ "$domain" = *[![:ascii:]]* ]]; then
 	if [[ "$domain" = *[![:ascii:]]* ]]; then
-		domain_idn=$(idn2 --quiet $domain)
+		domain_idn=$(idn2 --quiet "$domain")
 	else
 	else
 		domain_idn=$domain
 		domain_idn=$domain
 	fi
 	fi
+
+	# Set SOA refresh value based on TLD
+	tld="${domain_idn##*.}"
+	case "$tld" in
+		de | cz | pl | pt)
+			refresh=1800
+			;;
+		*)
+			refresh=3600
+			;;
+	esac
+
 	zn_conf="$HOMEDIR/$user/conf/dns/$domain.db"
 	zn_conf="$HOMEDIR/$user/conf/dns/$domain.db"
-	echo "\$TTL $TTL
+	echo "\$TTL $zone_ttl
 @    IN    SOA    $SOA.    root.$domain_idn. (
 @    IN    SOA    $SOA.    root.$domain_idn. (
                                             $SERIAL
                                             $SERIAL
                                             7200
                                             7200
-                                            3600
+                                            $refresh
                                             1209600
                                             1209600
                                             180 )
                                             180 )
 " > $zn_conf
 " > $zn_conf
+
 	fields='$RECORD\t$TTL\tIN\t$TYPE\t$PRIORITY\t$VALUE'
 	fields='$RECORD\t$TTL\tIN\t$TYPE\t$PRIORITY\t$VALUE'
 	while read line; do
 	while read line; do
 		unset TTL
 		unset TTL