From 7571492928f29ef3e123b845ad0c1a0c6d3c995c Mon Sep 17 00:00:00 2001 From: Zoldan Date: Fri, 23 Sep 2016 19:41:39 +0200 Subject: [PATCH] working nslookup for IPV6 and V4 --- getssl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/getssl b/getssl index 9bb39b3..5e52d83 100755 --- a/getssl +++ b/getssl @@ -141,6 +141,7 @@ _FORCE_RENEW=0 _QUIET=0 _UPGRADE=0 _UPGRADE_CHECK=1 +IPV6=false # store copy of original command in case of upgrading script and re-running ORIGCMD="$0 $*" @@ -1016,8 +1017,14 @@ for d in $alldomains; do # check nslookup for domains (ignore if using DNS check, as site may not be published yet) if [[ $VALIDATE_VIA_DNS != "true" ]]; then debug "checking nslookup for ${d}" - if [ "$(nslookup "${d}"| grep -c ^Name)" -lt 1 ]; then - error_exit "DNS lookup failed for $d" + if [[ "$IPV6" == "true" ]]; then + if [ "$(nslookup -query=AAAA "${d}"|grep -c ^""${d}".*has AAAA address")" -lt 1 ]; then + error_exit "DNS lookup IPV6 failed for $d" + fi + else + if [ "$(nslookup "${d}"| grep -c ^Name)" -lt 1 ]; then + error_exit "DNS lookup failed for $d" + fi fi fi done