It was evening, there was nothing to do ... © S. V. Mikhalkov
Inspired by the publication of “I was looking for viruses with bindʻom ...” , and specifically with this thread of comments . I hope not late posting.I was sitting thinking that the Samsung TV, WinPhone,
(and subsequently the coffee maker and vacuum cleaner) show super-annoying ads, you have to do something about it, and since WinPhone and the TV
(coffee maker, vacuum cleaner) have no AdBlock plug-in, then it should be where it goes their traffic on the router.
It turned out nothing complicated here, I have a TP-Link 1043 router, with a usb port, a flash drive mounted to / root, no one has a flash drive, you can use / tmp, replace the paths.
')
To begin with we will teach the standard dnsmasq to work with an external host file.
In the / etc / config / dhcp file add the line:
config dnsmasq list addnhosts '/root/hosts/adfree' list addnhosts '/root/hosts/unchanged'
I use the file
/ root / hosts / unchanged to add my own hosts rules, or which are not in adfree.
Along the way / root / hosts / create a script
upd-adfree.sh that
downloads the latest adfree lists (the link that the android phone uses) and modifies it as hosts, then reloads dnsmasq in order for it to read the new files.
And give the right to perform:
chmod +x /root/hosts/upd-adfree.sh
add the line in / etc / crontabs / root
0 0 * * * /root/hosts/upd-adfree.sh
What it means to run the script every day at 0:00.
Activate cron:
/etc/init.d/cron enable
Actually, everything. Of course, not everything is blocked, do not compare with AdBlockPlus in desktop browsers, for this you need to install a proxy, but a small load is coming.
Advantages for me: WinPhone does not show ads in games, a girl on a computer does not pop up video ads of every
$ 1000 per day doing nothing from some kind of forum, which does not work if he sees adblock plugins, YouTube doesn’t scream advertising on the whole house.
The minuses found by me: Some sites are able to determine adblock by the size of advertising windows, such will be outraged.
Well, by tradition, I ask you to write errors in private messages,
I will correct them .