Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/proxyresolv')
-rwxr-xr-xsrc/proxyresolv17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/proxyresolv b/src/proxyresolv
index ae932c2..f10a412 100755
--- a/src/proxyresolv
+++ b/src/proxyresolv
@@ -1,10 +1,8 @@
#!/bin/sh
-# This is a legacy script that uses "dig" to do DNS lookups via TCP.
-# it is not actively maintained since proxychains no longer depends
-# on it. i leave it here as a bonus.
+# This is a legacy script that uses "dig" or "drill" to do DNS lookups via TCP.
# DNS server used to resolve names
-DNS_SERVER=8.8.8.8
+test -z "$DNS_SERVER" && DNS_SERVER=8.8.8.8
if [ $# = 0 ] ; then
@@ -14,5 +12,12 @@ if [ $# = 0 ] ; then
fi
-export LD_PRELOAD=libproxychains4.so
-dig $1 @$DNS_SERVER +tcp | awk '/A.?[0-9]+\.[0-9]+\.[0-9]/{print $5;}'
+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