diff --git a/dns_scripts/dns_add_nsupdate b/dns_scripts/dns_add_nsupdate index a3429ee..f3d9971 100755 --- a/dns_scripts/dns_add_nsupdate +++ b/dns_scripts/dns_add_nsupdate @@ -11,7 +11,7 @@ token="$2" # DNS_NSUPDATE_GETKEY - command to execute if access to the key file requires # some special action: mounting a disk, decrypting a file.. # Called with the operation 'add' and action 'open" / 'close' - +# DNS_NSUPDATE_LOCALIP - IP source address for update (TSIG is preferred) Can be addressport. if [ -n "${DNS_NSUPDATE_KEYFILE}" ]; then if [ -n "${DNS_NSUPDATE_KEY_HOOK}" ] && ! ${DNS_NSUPDATE_KEY_HOOK} 'add' 'open' "${fulldomain}" ; then @@ -26,6 +26,7 @@ if [ -n "${DNS_SERVER}" ]; then cmd+="server ${DNS_SERVER}\n" fi +[ -n "$DNS_NSUPDATE_LOCALIP" ] && cmd+="local ${DNS_NSUPDATE_LOCALIP}\n" cmd+="update add ${DNS_ZONE:-"_acme-challenge.${fulldomain}."} 300 in TXT \"${token}\"\n" cmd+="\n" # blank line is a "send" command to nsupdate diff --git a/dns_scripts/dns_del_nsupdate b/dns_scripts/dns_del_nsupdate index 0c1494b..8cddc58 100755 --- a/dns_scripts/dns_del_nsupdate +++ b/dns_scripts/dns_del_nsupdate @@ -12,6 +12,7 @@ token="$2" # some special action: dismounting a disk, encrypting a # file... Called with the operation 'del' and action # 'open" / 'close' +# DNS_NSUPDATE_LOCALIP - IP source address for update (TSIG is preferred) Can be addressport. if [ -n "${DNS_NSUPDATE_KEYFILE}" ]; then if [ -n "${DNS_NSUPDATE_KEY_HOOK}" ] && ! "${DNS_NSUPDATE_KEY_HOOK}" 'del' 'open' "${fulldomain}" ; then @@ -26,6 +27,7 @@ if [ -n "${DNS_SERVER}" ]; then cmd+="server ${DNS_SERVER}\n" fi +[ -n "$DNS_NSUPDATE_LOCALIP" ] && cmd+="local ${DNS_NSUPDATE_LOCALIP}\n" cmd+="update delete ${DNS_ZONE:-"_acme-challenge.${fulldomain}."} 300 in TXT \"${token}\"\n" cmd+="\n" # blank line is a "send" command to nsupdate