diff --git a/test/hostnames.sh b/test/hostnames.sh index 7f49ac44..9e341f7e 100644 --- a/test/hostnames.sh +++ b/test/hostnames.sh @@ -14,7 +14,7 @@ getIPs() { while IFS= read -r addr ; do # Check if Pi-hole can use itself to block a domain dig_result=$(dig +tries=1 +time=2 -x "${addr}" @127.0.0.1 +short) - if [[ $addr == "127.0.0.1" && $dig_result == "localhost." ]] || [[ $addr == "::1" && [[ $dig_result == "localhost." || $dig_result == "ip6-localhost." ]] ]] || [[ $dig_result == "pi.hole." ]]; then + if [[ $addr == "127.0.0.1" && $dig_result == "localhost." ]] || [[ $addr == "::1" && ( $dig_result == "localhost." || $dig_result == "ip6-localhost." ) ]] || [[ $dig_result == "pi.hole." ]]; then echo "${addr} is \"${dig_result}\": OK" else # Otherwise, show a failure