From 0e0b10349ae231c90fd2053046308212d5c1b55e Mon Sep 17 00:00:00 2001 From: Steven Haigh Date: Sun, 27 Nov 2016 00:56:40 +1100 Subject: [PATCH] Added ability to set DNS server location - as well as actually use 'send' to send the update to the server. --- example-dns-01-nsupdate-script.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/example-dns-01-nsupdate-script.md b/example-dns-01-nsupdate-script.md index ba3a013..2a68fc5 100644 --- a/example-dns-01-nsupdate-script.md +++ b/example-dns-01-nsupdate-script.md @@ -16,14 +16,16 @@ set -u set -o pipefail NSUPDATE="nsupdate -k /path/to/Kdnsupdatekey.private" +DNSSERVER="127.0.0.1" +ZONE="mydomain.com" TTL=300 case "$1" in "deploy_challenge") - printf "update add _acme-challenge.%s. %d in TXT \"%s\"\n\n" "${2}" "${TTL}" "${4}" | $NSUPDATE + printf "server %s\nzone %s.\nupdate add _acme-challenge.%s. %d in TXT \"%s\"\nsend\n" "${DNSSERVER}" "${ZONE}" "${2}" "${TTL}" "${4}" | $NSUPDATE ;; "clean_challenge") - printf "update delete _acme-challenge.%s. %d in TXT \"%s\"\n\n" "${2}" "${TTL}" "${4}" | $NSUPDATE + printf "server %s\nzone %s.\nupdate delete _acme-challenge.%s. %d in TXT \"%s\"\nsend\n" "${DNSSERVER}" "${ZONE}" "${2}" "${TTL}" "${4}" | $NSUPDATE ;; "deploy_cert") # do nothing for now