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

proxyresolv « src - github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f10a412b814884434f28104d6f1aa8bcf715f116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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