Skip to content

Commit 0617012

Browse files
committed
Moving DNS check to simple record lookup for regional cloudformation endpoint.
1 parent 78767f4 commit 0617012

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

bootstrap/src/scripts/boot_as_compute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -x
2020
. /opt/cfncluster/scripts/functions.shlib
2121

2222
# Check basic DNS
23-
check_dns_ns || error_exit "Basic DNS checks failed."
23+
check_dns_basic || error_exit "Basic DNS checks failed."
2424

2525
# Run preinstall script if defined
2626
run_preinstall

bootstrap/src/scripts/boot_as_master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -x
2020
. /opt/cfncluster/scripts/functions.shlib
2121

2222
# Check basic DNS
23-
check_dns_ns || error_exit "Basic DNS checks failed."
23+
check_dns_basic || error_exit "Basic DNS checks failed."
2424

2525
# Run preinstall script if defined
2626
run_preinstall

bootstrap/src/scripts/functions.shlib

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ function error_exit () {
1515
exit 1
1616
}
1717

18-
# Basic DNS check, using dnsdomain and checking for NS record
19-
function check_dns_ns () {
18+
# Basic DNS check, using A record for cloudformation endpoint
19+
function check_dns_basic () {
2020
TRY=0
21-
domain=$(dnsdomainname)
21+
domain="cloudformation.${cfn_region}.amazonaws.com"
2222
while [ $TRY -lt 3 ]; do
23-
host -t ns $domain >/dev/null
24-
check_ns=$?
25-
if [ $check_ns -eq 0 ]; then
23+
host $domain >/dev/null
24+
check_dns=$?
25+
if [ $check_dns -eq 0 ]; then
2626
break
2727
else
2828
sleep 10
2929
TRY=$(( $TRY + 1 ))
3030
fi
3131
done
32-
return $check_ns
32+
return $check_dns
3333
}
3434

3535
# Check DNS is working, as it is required for correct operation

0 commit comments

Comments
 (0)