安裝pi-hole
參考:官方手冊(cè)
curl -sSL https://install.pi-hole.net | bash 一鍵自動(dòng)安裝出錯(cuò),成功率0% 手冊(cè)中有手動(dòng)安裝
wget -O basic-install.sh https://install.pi-hole.net
sudo bash basic-install.sh
添加hosts后要手動(dòng)更新下 : tools - Update Gravity -
1.yhosts: https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts (國(guó)內(nèi)維護(hù)者屏蔽國(guó)內(nèi)網(wǎng)站廣告)
2.大圣凈化:https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts (主要針對(duì)國(guó)內(nèi)視頻網(wǎng)站)
3.1024_hosts:https://raw.githubusercontent.com/Goooler/1024_hosts/master/hosts (1024網(wǎng)站和澳門皇家賭場(chǎng))
4.Adaway: https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt (adaway官方)
5.Hblock:https://hblock.molinero.dev/hosts (綜合多種源集合體屏蔽廣告跟蹤和惡意軟件)
6.Mvps:https://winhelp2002.mvps.org/hosts.txt (屏蔽美歐地區(qū)英文網(wǎng)站相關(guān)的廣告)
7.YousList: https://raw.githubusercontent.com/yous/YousList/master/hosts.txt (主要屏蔽韓國(guó)人使用的網(wǎng)站廣告)
8.StevenBlack: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts (多源集合體偏向屏蔽國(guó)外網(wǎng)站廣告)
9.Google hosts:https://raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts (提高網(wǎng)站訪問速度)
路由端屏蔽規(guī)則
pihole 命令行操作
pihole -h # 顯示 pihole 命令行幫助信息
pihole -b -l # 顯示黑名單列表
pihole -b site1.com site2.com # 把 site1 和 site2 加入黑名單
pihole -b -d site1.com # 把 site1 從黑名單移除
pihole restartdns # 重啟服務(wù) 而不用重啟整個(gè)服務(wù)器