diff --git a/dnstest.sh b/dnstest.sh index a617d26..66cb1e1 100755 --- a/dnstest.sh +++ b/dnstest.sh @@ -2,7 +2,7 @@ command -v bc > /dev/null || { echo "error: bc was not found. Please install bc."; exit 1; } -{ command -v drill > /dev/null && dig=drill; } || { command -v dig > /dev/null && dig=dig; } || { echo "error: dig was not found. Please install dnsutils."; exit 1; } +command -v dig > /dev/null || { echo "error: dig was not found. Please install dnsutils."; exit 1; } NAMESERVERS=`cat /etc/resolv.conf | grep ^nameserver | cut -d " " -f 2 | sed 's/\(.*\)/&#&/'` @@ -35,7 +35,7 @@ PROVIDERSV6=" " # Testing for IPv6 -$dig +short +tries=1 +time=2 +stats @2a0d:2a00:1::1 www.google.com |grep 216.239.38.120 >/dev/null 2>&1 +dig +short +tries=1 +time=2 +stats @2a0d:2a00:1::1 www.google.com |grep 216.239.38.120 >/dev/null 2>&1 if [ $? = 0 ]; then hasipv6="true" fi @@ -84,7 +84,7 @@ for p in $NAMESERVERS $providerstotest; do printf "%-21s" "$pname" for d in $DOMAINS2TEST; do - ttime=`$dig +tries=1 +time=2 +stats @$pip $d |grep "Query time:" | cut -d : -f 2- | cut -d " " -f 2` + ttime=`dig +tries=1 +time=2 +stats @$pip $d |grep "Query time:" | cut -d : -f 2- | cut -d " " -f 2` if [ -z "$ttime" ]; then #let's have time out be 1s = 1000ms ttime=1000