fix missing bracket in solaris codepath (#589)
[rofl0r-proxychains-ng.git] / src / proxyresolv
blobf10a412b814884434f28104d6f1aa8bcf715f116
1 #!/bin/sh
2 # This is a legacy script that uses "dig" or "drill" to do DNS lookups via TCP.
4 # DNS server used to resolve names
5 test -z "$DNS_SERVER" && DNS_SERVER=8.8.8.8
8 if [ $# = 0 ] ; then
9 echo " usage:"
10 echo " proxyresolv <hostname> "
11 exit
15 test -z $LD_PRELOAD && export LD_PRELOAD=libproxychains4.so
17 if type dig 1>/dev/null 2>&1 ; then
18 dig $1 @$DNS_SERVER +tcp | awk '/A.?[0-9]+\.[0-9]+\.[0-9]/{print $5;}'
19 elif type drill 1>/dev/null 2>&1 ; then
20 drill -t4 $1 @$DNS_SERVER | awk '/A.+[0-9]+\.[0-9]+\.[0-9]/{print $5;}'
21 else
22 echo "error: neither dig nor drill found" >&2