项目地址:https://github.com/shawn1m/overture
相比ChinaDNS而言,overture对于国内外 DNS 的判断逻辑更完善,关键还支持 ECS。
国内首先支持ECS的是腾讯。
我在树莓派上搭建,减少了服务器开支费用,并非加上dnsmasq。
# 开始配置,参照我的配置修改。
{
"BindAddress": ":53", //运行端口
"DebugHTTPAddress": "127.0.0.1:5555",
"PrimaryDNS": [
{
"Name": "DNSPod", //腾讯DNS支持ENDS
"Address": "119.29.29.29:53",
"Protocol": "udp", //国内UDP没问题,你也可以换TCP
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "auto",
"ExternalIP": "",
"NoCookie": true
}
}
],
"AlternativeDNS": [
{
"Name": "OpenDNS",
"Address": "208.67.222.222:443",
"Protocol": "tcp", //TCP防止污染
"SOCKS5Address": "",
"Timeout": 6,
"EDNSClientSubnet": {
"Policy": "disable",
"ExternalIP": "",
"NoCookie": true
}
}
],
"OnlyPrimaryDNS": false,
"IPv6UseAlternativeDNS": false,
"WhenPrimaryDNSAnswerNoneUse": "PrimaryDNS",
"IPNetworkFile": {
"Primary": "./ip_network_primary_sample", //建议修改,看后文
"Alternative": "./ip_network_alternative_sample"
},
"DomainFile": {
"Primary": "./domain_primary_sample",
"Alternative": "./domain_alternative_sample" //建议修改,看后文
},
"HostsFile": "./hosts_sample",
"MinimumTTL": 0, //解析记录最小缓存时间(秒),0则不使用
"DomainTTLFile" : "./domain_ttl_sample",
"CacheSize" : 0, //缓存条数,0则不使用
"RejectQType": [255]
}
# IPNetworkFile - Primary 建议使用 [chnrouter](https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt "chnrouter")
# DomainFile - DomainFile
curl https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt | base64 -d | sort -u | sed '/^$\|@@/d'| sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' | sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /qq\.com/d' | sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' | grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | sort -u > /tmp/temp_gfwlist.txt
curl https://raw.githubusercontent.com/hq450/fancyss/master/rules/gfwlist.conf | sed 's/ipset=\/\.//g; s/\/gfwlist//g; /^server/d' > /tmp/temp_koolshare.txt
cat /tmp/temp_gfwlist.txt /tmp/temp_koolshare.txt | sort -u > domain_alternative_sample
#部分文件名称需要自己修改,包括路径。该部分代码参考 https://moe.best/tutorial/overture.html
# 运行
./overture 默认使用 ./config.json
./overture -c /path/to/config.json 自定义配置路径