diff --git a/rootfs/tmp/etc/bind/named.conf b/rootfs/tmp/etc/bind/named.conf index 65a1c94..ae799d4 100644 --- a/rootfs/tmp/etc/bind/named.conf +++ b/rootfs/tmp/etc/bind/named.conf @@ -8,7 +8,7 @@ key "backup-key" { algorithm hmac-sha512; secret "REPLACE_KEY_BACKUP"; }; ##################################################################### # access settings acl "all" { 0.0.0.0/0; ::/0; }; -acl "secondary" { REPLACE_DNS_SERVER_SECONDARY }; +acl "secondary" { REPLACE_DNS_SERVER_TRANSFER_IP }; acl "trusted" { 10.0.0.0/8; 127.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16; }; acl "updates" { key "dhcp-key"; key "certbot."; }; acl "transfers" {key "dhcp-key"; key "certbot."; key "backup-key"; secondary; }; @@ -27,9 +27,9 @@ options { max-ncache-ttl 10800; max-udp-size 4096; notify yes; - also-notify { REPLACE_DNS_SERVER_SECONDARY }; + also-notify { REPLACE_DNS_SERVER_TRANSFER_IP }; allow-update { updates; }; - allow-update-forwarding { REPLACE_DNS_SERVER_SECONDARY }; + allow-update-forwarding { REPLACE_DNS_SERVER_TRANSFER_IP }; allow-transfer { trusted; }; transfer-format many-answers; allow-query { any; }; diff --git a/rootfs/usr/local/etc/docker/init.d/02-named.sh b/rootfs/usr/local/etc/docker/init.d/02-named.sh index 72200f4..3ac14e3 100755 --- a/rootfs/usr/local/etc/docker/init.d/02-named.sh +++ b/rootfs/usr/local/etc/docker/init.d/02-named.sh @@ -171,7 +171,8 @@ KEY_CERTBOT="${KEY_CERTBOT:-$(__certbot_key || __tsig_key sha512)}" DNS_TYPE="${DNS_TYPE:-primary}" DNS_REMOTE_SERVER="${DNS_REMOTE_SERVER:-}" DNS_SERVER_PRIMARY="${DNS_SERVER_PRIMARY:-127.0.0.1}" -DNS_SERVER_SECONDARY="${DNS_SERVER_SECONDARY:-127.0.0.1}" +DNS_SERVER_SECONDARY="${DNS_SERVER_SECONDARY:-}" +DNS_SERVER_TRANSFER_IP="${DNS_SERVER_TRANSFER_IP:-}" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Specifiy custom directories to be created ADD_APPLICATION_FILES="" @@ -263,12 +264,12 @@ __update_conf_files() { touch "$LOG_DIR/$logfile" chmod -Rf 777 "$logfile" done - if [ -n "$DNS_SERVER_SECONDARY" ]; then - for ip in ${DNS_SERVER_SECONDARY//;/ }; do + if [ -n "$DNS_SERVER_TRANSFER_IP" ]; then + for ip in ${DNS_SERVER_TRANSFER_IP//;/ }; do secondary_ip+="$ip; " done + DNS_SERVER_TRANSFER_IP="$secondary_ip" fi - DNS_SERVER_SECONDARY="$secondary_ip" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # replace variables __replace "REPLACE_KEY_RNDC" "$KEY_RNDC" "$ETC_DIR/rndc.key" @@ -278,10 +279,10 @@ __update_conf_files() { __replace "REPLACE_KEY_CERTBOT" "$KEY_CERTBOT" "$NAMED_CONFIG_FILE" __find_replace "REPLACE_DNS_SERIAL" "$DNS_SERIAL" "$DATA_DIR/primary" __find_replace "REPLACE_DNS_SERIAL" "$DNS_SERIAL" "$DATA_DIR/secondary" - if [ -n "$DNS_SERVER_SECONDARY" ]; then - __replace "REPLACE_DNS_SERVER_SECONDARY" "$DNS_SERVER_SECONDARY" "$NAMED_CONFIG_FILE" + if [ -n "$DNS_SERVER_TRANSFER_IP" ]; then + __replace "REPLACE_DNS_SERVER_TRANSFER_IP" "$DNS_SERVER_TRANSFER_IP" "$NAMED_CONFIG_FILE" else - sed -i '/REPLACE_DNS_SERVER_SECONDARY/d' "$NAMED_CONFIG_FILE" + sed -i '/REPLACE_DNS_SERVER_TRANSFER_IP/d' "$NAMED_CONFIG_FILE" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # define actions