Skip to content

Commit d2122f8

Browse files
committed
Check if dns records are present, thanks to @ioannidesalex!
1 parent fdf94dc commit d2122f8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/v-add-letsencrypt-domain

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ else
113113
proto="http-01"
114114
fi
115115

116+
# Check if dns records exist for requested domain/aliases
117+
if [ "$proto" = "http-01"]; then
118+
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
119+
if ! nslookup "${identifier}" >/dev/null 2>&1 ; then
120+
check_result $E_NOTEXIST "DNS record for $identifier doesn't exist"
121+
fi
122+
done
123+
fi
124+
116125
# Requesting nonce / STEP 1
117126
answer=$(curl -s -I "$LE_API/directory")
118127
nonce=$(echo "$answer" |grep Nonce |cut -f2 -d \ |tr -d '\r\n')

0 commit comments

Comments
 (0)