From d69f46afc5d121e5eaef655ec4ca7faedbeffc30 Mon Sep 17 00:00:00 2001 From: Xie Zhenye Date: Sat, 22 Sep 2012 22:17:53 +0800 Subject: [PATCH] Update src/proxyresolv resolve hostname by local /etc/hosts file first --- src/proxyresolv | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/proxyresolv b/src/proxyresolv index 05186df..8717aac 100755 --- a/src/proxyresolv +++ b/src/proxyresolv @@ -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"