樹莓派配合overture完成本地?zé)o污染DNS的搭建

項(xiàng)目地址:https://github.com/shawn1m/overture

相比ChinaDNS而言,overture對(duì)于國內(nèi)外 DNS 的判斷邏輯更完善,關(guān)鍵還支持 ECS。
國內(nèi)首先支持ECS的是騰訊。

我在樹莓派上搭建,減少了服務(wù)器開支費(fèi)用,并非加上dnsmasq。

# 開始配置,參照我的配置修改。
{
  "BindAddress": ":53",  //運(yùn)行端口
  "DebugHTTPAddress": "127.0.0.1:5555",
  "PrimaryDNS": [
    {
      "Name": "DNSPod", //騰訊DNS支持ENDS
      "Address": "119.29.29.29:53",
      "Protocol": "udp", //國內(nèi)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,  //解析記錄最小緩存時(shí)間(秒),0則不使用
  "DomainTTLFile" : "./domain_ttl_sample",
  "CacheSize" : 0,   //緩存條數(shù),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
# 運(yùn)行
./overture  默認(rèn)使用 ./config.json
./overture -c /path/to/config.json 自定義配置路徑
捕獲.PNG
捕獲2.PNG
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容