使用 overtureDns和 updateHosts搭建智能Dns

? ? ? ? ?使用 overtureDns和 updateHosts搭建智能Dns

關(guān)于這兩個(gè)項(xiàng)目 :overtureDns:??github.com/shawn1m/overture?

? ? ? ? ? ? ? ? ? ? ? ? ? ? ?updateHosts:??github.com/ladder1984/updateHosts


二??

? ? ? ? ? ? ? ? ? ? ?搭建dns (centos) :??

打開(kāi)防火墻53 udp端口:(如果你是firewall)

firewall-cmd --zone=public --add-port=53/udp --permanent

firewall-cmd --reload

下載overtureDns并且賦予權(quán)限:? ?

wget https://github.com/shawn1m/overture/releases/download/1.3.5.2/overture-linux-amd64.zip

unzip overture-linux-amd64.zip

chmod 774 overture-linux-amd64

關(guān)于overtureDns 此目錄的config.json中

vi config.json

修改PrimaryDNS中的

Policy屬性 改為 “auto”

"HostsFile":屬性改為 "/etc/hosts"


PrimaryDNS 中的Address默認(rèn)為騰訊 : 119.29.29.29

AlternativeDNS中的Address為 openDns:? 208.67.222.222

簡(jiǎn)單理解就是國(guó)內(nèi)地址由119.29.29.29返回,國(guó)外地址由 opendns 返回? ?--- 爽

運(yùn)行

nohup ./overture-linux-amd64&

其實(shí)運(yùn)行之后直接配置可以訪問(wèn)一些封鎖不嚴(yán)重的網(wǎng)站:

比如? instagram,請(qǐng)忽略tumblr...

關(guān)于hosts翻墻問(wèn)題經(jīng)常? ?需要自己手動(dòng)或者工具定期更新使用:

所有可以使用服務(wù)器自己更新 overtureDns返回:

定期更新hosts:

wget https://github.com/ladder1984/updateHosts/archive/master.zip

unzip updateHosts-master.zip

配置參數(shù)

hosts源推薦

raw.githubusercontent.com/Lerist/Go-Hosts/master/hosts? (推薦)

raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts?更新很快(我這里不能用)

vi config.ini

修改? source1 = https://raw.githubusercontent.com/Lerist/Go-Hosts/master/hosts

? ? ? ? always_on = 1

編輯 python腳本:

vi updateHosts.py

修改底部改為? ? time.sleep(36000)? ? 改為10小時(shí)更新一次hosts

運(yùn)行:

chmod 774 updateHosts.py

setsid python updateHosts.py

電腦dns改為你服務(wù)器可以進(jìn)行訪問(wèn) 谷歌 youtube等(使用https訪問(wèn))

https://www.google.com/ncr

ps:??

正確使用谷歌搜索,建議僅使用谷歌進(jìn)行學(xué)術(shù)研究。

最后編輯于
?著作權(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),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

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

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