首页 > 代码库 > temp

temp

两个方案更新如下。方案一:* 下载:https://raw.githubusercontent.com/holmium/dnsforwarder/5/mac_bin/dnsforwarder* 终端:chmod +x dnsforwarder* 终端:open .* 在打开的目录中,将以下内容保存为 dnsf.config# 主服务器协议设为 UDPPrimaryServer UDP# UDP 服务器中务必有一个国外服务器UDPServer 114.114.114.114, 114.114.115.115, 8.8.8.8, 8.8.4.4, 199.91.73.222, 178.79.131.110TCPServer 8.8.8.8, 8.8.4.4, 199.91.73.222, 178.79.131.110 # 开启并发查询ParallelQuery true# 开启 DNS 反投毒过滤UDPAntiPollution true# 过滤伪造 IPUDPBlock_IP 37.61.54.158, 59.24.3.173, 72.52.244.56, 157.112.145.6, 80.76.158.94, 207.230.151.254, 184.154.10.146, 91.208.42.72, 199.48.254.135, 109.71.81.130, 193.104.136.38, 189.36.20.55, 119.18.57.230, 62.76.188.152, 54.92.59.138, 74.201.113.25, 54.243.105.190, 198.1.104.147, 46.182.20.123, 178.16.44.201, 221.213.49.149, 92.53.98.146, 188.138.122.63, 83.222.124.187, 194.247.136.56, 50.22.7.222, 14.192.41.68, 216.52.252.88, 193.239.132.44, 96.30.47.216, 204.236.218.138, 203.98.7.65, 108.167.140.229, 46.163.109.39, 4.31.18.250, 64.131.66.92, 173.203.62.250, 213.239.227.125# GfwList 置空GfwList* 终端:sudo mv ./dnsforwarder /usr/bin/dnsforwarder* 终端:sudo mv ./dnsf.config /usr/bin/dnsf.config* 终端:sudo dnsforwarder -d -f dnsf.config # 这里加上 -d 参数是为了让 dnsforwarder 在后台以守护进程的方式运行* 系统偏好设置 - 网络 - Wi-Fi - (解锁之后点击)高级 - DNS - 左下角的加号 - 填入「127.0.0.1」* 在 GoAgent 的配置中,找到 [dns] section,以 enable = 0 关闭 GoAgent 的 DNS 模块* 运行 GoAgent,终端:sudo ./goagent-osx.command* enjoy方案二:* 安装好 Home Brew, Python-pip, Python-setuptools, Python-gevent, Python-dnslib 等备用* 终端:brew install automake* 终端:brew install libtool* 终端:sudo pip install pyuv* 终端:git clone git@github.com:saghul/uvent.git* 终端:cd uvent* 终端:sudo python setup.py install* 打开 GoAgent 里的 dnsproxy.py* 在 11 行的位置(import gevent 之前),插入两行代码:    import uvent    uvent.install()* 在 GoAgent 的配置中,找到 [dns] section,将相关配置修改为:[dns]enable = 1listen = 127.0.0.1:53servers = 199.91.73.222|178.79.131.110|8.8.8.8|8.8.4.4|168.95.1.1|168.95.192.1|223.5.5.5|223.6.6.6|114.114.114.114|114.114.115.115* 以 root 权限运行 GoAgent* enjoy

temp