您的位置:首页 > 运维架构

IMX6之openwrt使用dnsmasq实现广告过滤

2017-05-19 18:31 761 查看

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


简介

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


方法

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

[html] view
plain copy

#add dnsmasq.ads rule list  

conf-file=/etc/dnsmasq.ads  

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

[html] view
plain copy

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  imx6 openwrt 广告 过滤