Total Pageviews

Thursday 8 August 2019

又一个可以在其外面套上一层socks proxy的dns代理程序:dnsforwarder-by-regret1537

在mac机器上。
git clone https://github.com/regret1537/dnsforwarder dnsforwarder-by-regret1537
cd dnsforwarder-by-regret1537
./configure
make
(会在当前目录下,生成可执行文件dnsforwarder)
nano default-en.config
其内容如下:
LogOn false
LogFileThresholdLength 102400
LogFileFolder
LocalInterface 127.0.0.1
LocalPort 53
OpenLocalTCP true
PrimaryServer TCP
TCPServer 8.8.4.4,8.8.8.8
TCPProxy 127.0.0.1:1080
UDPServer 208.67.220.220
UDPFilter true
UDPBlock_IP 243.185.187.39,46.82.174.68,37.61.54.158,93.46.8.89,59.24.3.173,203.98.7.65,8.7.198.45,78.16.49.15,159.106.121.75
IPSubstituting
ExcludedDomain
ExcludedList
AlwaysTCP
Hosts
HostsUpdateInterval 18000
HostsDownloadPath
HostsScript
HostsRetryInterval 30
AppendHosts
DisableIpv6WhenIpv4Exists false
UseCache false
CacheSize 1048576
MemoryCache true
CacheFile
IgnoreTTL false
OverrideTTL -1
MultipleTTL 1
ReloadCache false
OverwriteCache false
DisabledType
DisabledDomain
DisabledList
RefusingResponseCode 0
DomainStatistic false
DomainStatisticTempletFile
StatisticUpdateInterval 29


然后运行:
sudo ./dnsforwarder -f default-en.config
不要关闭此terminal窗口。

看见配置文件里面的TCPProxy 127.0.0.1:1080了吗?这个dnsforwarder-by-regret1537其实是修改自https://github.com/holmium/dnsforwarder ,但是https://github.com/holmium/dnsforwarder/blob/6/default.config和https://github.com/holmium/dnsforwarder/blob/6/default.en.config里面均没有TCPProxy这一项。但是https://github.com/regret1537/dnsforwarder/blob/5/default.config里面有TCPProxy这一项。所以我们可以替dnsforwarder-by-regret1537套一层socks proxy,比如ss.

实际使用例子:
sudo wg-quick up wg0 

sudo networksetup -setdnsservers "Wi-Fi" 127.0.0.1
cd ~/dnsforwarder-by-regret1537 && sudo ./dnsforwarder -f default-en.config

项目地址:https://github.com/regret1537/dnsforwarder

此文https://briteming.blogspot.com/2019/07/dns-querysocks.html又要添上一员了。

ps.其实https://github.com/holmium/dnsforwarder/blob/5/default.config里面有TCPProxy这一项,所以https://github.com/holmium/dnsforwarder的v5版也是支持TCPProxy这一项的。




No comments:

Post a Comment