241
241
# 2020-10-02 Various fixes to get_auth_dns and changes to support unit tests (#308)
242
242
# 2020-10-04 Add CHECK_PUBLIC_DNS_SERVER to check the DNS challenge has been updated there
243
243
# 2020-10-13 Bugfix: strip comments in drill/dig output (mhameed)
244
- # 2020-11-18 Wildcard support (#347)(#400)
244
+ # 2020-11-18 Wildcard support (#347)(#400)(2.31)
245
245
# ----------------------------------------------------------------------------------------
246
246
247
247
PROGNAME=${0##*/ }
248
248
PROGDIR=" $( cd " $( dirname " $0 " ) " || exit ; pwd -P; ) "
249
- VERSION=" 2.30 "
249
+ VERSION=" 2.31 "
250
250
251
251
# defaults
252
252
ACCOUNT_KEY_LENGTH=4096
@@ -1255,13 +1255,11 @@ done # end of ... loop through domains for cert ( from SANS list)
1255
1255
1256
1256
get_auth_dns () { # get the authoritative dns server for a domain (sets primary_ns )
1257
1257
orig_gad_d=" $1 " # domain name
1258
- gad_s=" $PUBLIC_DNS_SERVER " # start with PUBLIC_DNS_SERVER
1259
- if [[ -n " $gad_s " ]]; then
1260
- gad_s=" @$gad_s "
1261
- fi
1258
+ orig_gad_s=" $PUBLIC_DNS_SERVER " # start with PUBLIC_DNS_SERVER
1259
+ gad_d=" $orig_gad_d "
1260
+ gad_s=" $orig_gad_s "
1262
1261
1263
1262
if [[ " $os " == " cygwin" ]]; then
1264
- gad_d=" $orig_gad_d "
1265
1263
# shellcheck disable=SC2086
1266
1264
all_auth_dns_servers=$( nslookup -type=soa " ${d} " ${PUBLIC_DNS_SERVER} 2> /dev/null \
1267
1265
| grep " primary name server" \
@@ -1278,7 +1276,10 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n
1278
1276
fi
1279
1277
1280
1278
if [[ -n " $HAS_DIG_OR_DRILL " ]]; then
1281
- gad_d=" $orig_gad_d "
1279
+ if [[ -n " $gad_s " ]]; then
1280
+ gad_s=" @$gad_s "
1281
+ fi
1282
+
1282
1283
# Use SOA +trace to find the name server
1283
1284
if [[ $_TEST_SKIP_SOA_CALL == 0 ]]; then
1284
1285
if [[ " $HAS_DIG_OR_DRILL " == " dig" ]]; then
@@ -1350,6 +1351,9 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n
1350
1351
fi
1351
1352
fi
1352
1353
1354
+ # Remove leading '@' if we tried using dig/drill
1355
+ gad_s=" $orig_gad_s "
1356
+
1353
1357
if [[ " $HAS_HOST " == " true" ]]; then
1354
1358
gad_d=" $orig_gad_d "
1355
1359
debug Using " host -t NS" to find primary name server for " $gad_d "
0 commit comments