最近总有人吐槽网上编译的OpenWRT自带Adguardhome总有问题,吐槽君就是吐槽大军之一。
看了下发现无论是设置
作为dnsmasq的上游服务器
还是
重定向53端口到adguardhome
还是
使用53端口替换dnsmasq
都有问题。
好在网上有人说了解决方法:
启动openwrt附带的adguardhome之前,先去防火墙那里把53注释掉
#iptables -t nat -A PREROUTING -p udp –dport 53 -j REDIRECT –to-ports 53
#iptables -t nat -A PREROUTING -p tcp –dport 53 -j REDIRECT –to-ports 53
#[ -n “$(command -v ip6tables)” ] && ip6tables -t nat -A PREROUTING -p udp –dport 53 -j REDIRECT –to-ports 53
#[ -n “$(command -v ip6tables)” ] && ip6tables -t nat -A PREROUTING -p tcp –dport 53 -j REDIRECT –to-ports 53
然后选择“作为dnsmasq的上游服务器”
再然后启动 adguardhome
接着在openwrt的设置 – DHCP/DNS – DNS转发处输入两行:
127.0.0.1#52
路由器地址#52
不要问吐槽君为什么是52端口,我也不知道。
然后再去防火墙处,给52端口输入防火墙规则,其实就是把上面53改成52。。。
iptables -t nat -A PREROUTING -p udp –dport 53 -j REDIRECT –to-ports 52
iptables -t nat -A PREROUTING -p tcp –dport 53 -j REDIRECT –to-ports 52
完事
对了,转发点adguardhome规则
参考过滤规则(按需食用,并不需要全部都订阅):
- 自带规则:AdGuard DNS filter – https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
- 自带规则:MalwareDomainList.com Hosts List – https://www.malwaredomainlist.com/hostslist/hosts.txt
- 自带规则:AdAway – https://adaway.org/hosts.txt
- anti-AD – https://anti-ad.net/easylist.txt 官宣:anti-AD 是目前中文区命中率最高广告过滤列表,实现了精确广告屏蔽和隐私保护。
- neoHosts Full 127.0.0.1 – https://hosts.nfz.moe/127.0.0.1/full/hosts 官宣:neoHosts 自由、负责、克制 的去广告 Hosts
- Easylist 官方规则 – https://easylist.to/easylist/easylist.txt
- EasylistChina+EasylistLite+CJX’sAnnoyance – https://raw.githubusercontent.com/o0HalfLife0o/list/master/ad.txt 简介:由 halflife 维护,合并了 EasylistChina、EasylistLite、CJX’sAnnoyance,以及一些补充规则,每日更新。
- EasyPrivacy 隐私保护 – https://easylist-downloads.adblockplus.org/easyprivacy.txt
- CJX’s Annoyance List – https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt
- EasyList China 中文补充规则 – https://easylist-downloads.adblockplus.org/easylistchina.txt
- EasyList Lite 中文精简规则 – https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt