路由器广告过滤设置

路由器使用dnsmasq实现广告过滤

  • 简介

路由器上广告过滤可以通过dnsmasq配置实现,dnsmasq是路由器的DNS域名缓存与DHCP服务器二合一,通过DNS域名重定向把广告的地址重定向即可实现广告过滤。dnsmasq的配置文件是/etc/dnsmasq.conf.

  • 方法

编辑/etc/dnsmasq.conf,加入下面一条配置:

#add dnsmasq.ads rule list
conf-file=/etc/dnsmasq.ads


更新/etc/dnsmasq.ads文件,获取最新的广告域名列表:

wget --no-check-certificate -qO - https://easylist-downloads.adblockplus.org/chinalist+easylist.txt | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' > /etc/dnsmasq.ads



重启dnsmasq服务

/etc/init.d/dnsmasq restart

你可能感兴趣的:(openwrt,dnsmasq,广告过滤)