2011-02-25 09:40:11 +00:00
|
|
|
#!/bin/sh
|
2020-09-20 21:11:17 +00:00
|
|
|
# This is a legacy script that uses "dig" or "drill" to do DNS lookups via TCP.
|
2011-02-25 09:40:11 +00:00
|
|
|
|
|
|
|
# DNS server used to resolve names
|
2020-09-20 21:11:17 +00:00
|
|
|
test -z "$DNS_SERVER" && DNS_SERVER=8.8.8.8
|
2011-02-25 09:40:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
if [ $# = 0 ] ; then
|
|
|
|
echo " usage:"
|
|
|
|
echo " proxyresolv <hostname> "
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2020-09-20 21:11:17 +00:00
|
|
|
test -z $LD_PRELOAD && export LD_PRELOAD=libproxychains4.so
|
|
|
|
|
|
|
|
if type dig 1>/dev/null 2>&1 ; then
|
|
|
|
dig $1 @$DNS_SERVER +tcp | awk '/A.?[0-9]+\.[0-9]+\.[0-9]/{print $5;}'
|
|
|
|
elif type drill 1>/dev/null 2>&1 ; then
|
|
|
|
drill -t4 $1 @$DNS_SERVER | awk '/A.+[0-9]+\.[0-9]+\.[0-9]/{print $5;}'
|
|
|
|
else
|
|
|
|
echo "error: neither dig nor drill found" >&2
|
|
|
|
fi
|