mirror of
https://github.com/haad/proxychains.git
synced 2026-09-13 18:45:50 +05:00
Update src/proxyresolv
resolve hostname by local /etc/hosts file first
This commit is contained in:
parent
f9a2ac0456
commit
d69f46afc5
@ -2,7 +2,7 @@
|
||||
# This script is called by proxychains to resolve DNS names
|
||||
|
||||
# DNS server used to resolve names
|
||||
DNS_SERVER=4.2.2.2
|
||||
DNS_SERVER=8.8.8.8
|
||||
|
||||
|
||||
if [ $# = 0 ] ; then
|
||||
@ -11,6 +11,10 @@ if [ $# = 0 ] ; then
|
||||
exit
|
||||
fi
|
||||
|
||||
awk 'BEGIN{ARGC=0} {for(i=2;i<=NF;i++){if($i==ARGV[1] && $1!~":"){print $1;found=1}} } END{exit found?0:1}' "$1" </etc/hosts
|
||||
if [[ "$?" -eq "0" ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
export LD_PRELOAD=libproxychains.so
|
||||
dig $1 @$DNS_SERVER +tcp | awk '/A.+[0-9]+\.[0-9]+\.[0-9]/{print $5;}'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user