diff --git a/check_ptr.sh b/check_ptr.sh index c641ef7..b34ba1e 100644 --- a/check_ptr.sh +++ b/check_ptr.sh @@ -10,14 +10,16 @@ if [[ $# -ne 1 ]]; then exit 1 fi +DNS="84.2.44.1" + # Get IPs -IPS="$(dig +short $1 A | sort -u) $(dig +short $1 AAAA | sort -u)" +IPS="$(dig +short $1 A @$DNS | sort -u) $(dig +short $1 AAAA @$DNS | sort -u)" # Loop through IPs fails=0 for IP in $IPS; do # Performs the actual lookup against blacklists - RESULT=$(host $IP | rev | cut -d" " -f1 | rev | sed 's/.$//') + RESULT=$(host $IP $DNS | tail -1 | rev | cut -d" " -f1 | rev | sed 's/.$//') if [ "$RESULT" != "$1" ]; then ((fails++)) fi