Александр Рыжов Posted February 5, 2018 Share Posted February 5, 2018 How to remove ads from web pages and Android apps. Before: After: Installation Install necessary packages: opkg install dnsmasq-full iptables ndmq Create a netfilter hook /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: #!/bin/sh [ "$table" != "nat" ] && exit 0 lan_ip=$(ndmq -p 'show interface Bridge0' -P address) iptables -t nat -I PREROUTING -p udp -m udp --dport 53 -j DNAT --to-destination $lan_ip:65053 iptables -t nat -I PREROUTING -p tcp -m tcp --dport 53 -j DNAT --to-destination $lan_ip:65053 Make it executable: chmod +x /opt/etc/ndm/netfilter.d/010-intercept-dns.sh Add the following lines to the /opt/etc/dnsmasq.conf: no-resolv server=77.88.8.88#1253 server=77.88.8.2#1253 port=65053 Download your favorite blacklist to /opt/etc/hosts. For example: wget -O /opt/etc/hosts http://winhelp2002.mvps.org/hosts.txt Done! Reboot your router for the changes to take effect. Troubleshooting Make sure you have not configured custom DNS servers in the Internet Connection properties. Flush your operating system DNS cache (in Windows — ipconfig /flushdns) Close and open your web browser. Notes Notes The iptables rules redirect all DNS requests to the dnsmasq. The dnsmasq uses /opt/etc/hosts as an exception list. Yandex.DNS anti-ad servers are used for the unlisted hostnames. You can replace Yandex.DNS with Norton ConnectSafe or AdGuard public servers. Quote Link to comment Share on other sites More sharing options...
ikebanat Posted January 27, 2022 Share Posted January 27, 2022 the ndmq package is not available Quote Link to comment Share on other sites More sharing options...
MercuryV Posted January 27, 2022 Share Posted January 27, 2022 41 минуту назад, ikebanat сказал: ndmq package is not available 1. You can install packages libndm and ndmq from archive (for mipsel - http://bin.entware.net/mipselsf-k3.4/keenetic/archive/). But it's deprecated. 2. You can install package jq and use RCI interface. Something like wget -qO - http://127.0.0.1:79/rci/show/interface/Bridge0 | jq -r '.address' Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.