1
0
mirror of https://github.com/rofl0r/proxychains-ng synced 2026-05-14 09:32:35 +08:00
Files
proxychains-ng/src/proxyresolv
T
rofl0r 2ab631918d add support for "proxy_dns_old" to use old 3.1 DNS lookup method
some lamer on IRC by the name of annoner/R3M0RS3/penis was complaining
that 3.1 is a lot better than proxychains-ng, because it happens to
work with the browser he's interested in.
since this wasn't the first time this is requested, let's give this
those lamers what they want: lame code!
2020-09-20 22:11:17 +01:00

24 lines
599 B
Bash
Executable File

#!/bin/sh
# This is a legacy script that uses "dig" or "drill" to do DNS lookups via TCP.
# DNS server used to resolve names
test -z "$DNS_SERVER" && DNS_SERVER=8.8.8.8
if [ $# = 0 ] ; then
echo " usage:"
echo " proxyresolv <hostname> "
exit
fi
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