4 ms·
It's a lot less resource intensive not to use a hosts file. This might not be a concern for people with modern machines, but having a hosts file with 12,000 lin
by pgl 11y ago
It's a lot less resource intensive not to use a hosts file. This might not be a concern for people with modern machines, but having a hosts file with 12,000 lines in it does take a certain amount of processing.
If I might mention my own site for a minute, I maintain a list of ad server (and tracking server) hostnames: http://pgl.yoyo.org/adservers/ http://pgl.yoyo.org/adservers/
You can view the list as a dnsmasq config file, a BIND config file, and a bunch of other formats.
- userbinator 11y agoAlso, running your own DNS server means you can do this for every device, even those for which you can't easily access the HOSTS file or perhaps don't even have such a facility (locked-down mobile devices, embedded systems, etc) and not have to worry about keeping multiple copies of HOSTS files in sync and updated. Although I don't have such devices in my network, I've heard that others do this to their "smart" TV/media box/creepy home surveillance gadgets.
- pgl 11y agoYes, absolutely! It's way easier to configure your wifi router (or cable modem, or whatever acts as the DHCP server on your network) to use a local DNS server that blocks ads. Then ad blocking just works, whatever you connect to your network.
- chrismbarr 11y agois the best way to do this to run something like DD-WRT? Or is there a way to accomplish this with stock router firmware? I ask because I recently tried to install DD-WRT but ran into issue and had to revert to my stock firmware.
- ljoshua 11y agoAnother way to accomplish it if you've got a spare computer (even something like a Raspberry Pi) is to configure it as a DNS server and then use your stock router firmware, if it supports it, to point DNS servers to that computer's local IP. So one device in your home or network would then become the local resolver.
- laumars 11y agoPersonally I run dnsmasq on my file server (separate FreeBSD jail), but before then I was running it on my Asus router with pretty much the stock firmware. So I don't think there is a "best" approach specifically - just whatever works for you. What's your router model?
- chrismbarr 11y agoVery late in seeing this comment! It's a Netgear WNDR3700v4. DD-WRT is supported on it, and i did successfully get it installed, but I had no connection to the internet with it. There was a wiki page for my specific router model with instructions which I followed. I went back & forth with people on their forums and they were pretty much telling me "oh yeah, don't install that version that the instructions tell you to!" and "well yeah, this whole project is beta, so what do you expect?" All of that combined kind of turned me off to this project from now on :/
- laumars 11y agodnsmasq caches the hosts file so it's not that much an overhead. Anecdotally I've never had a problem with a 12k+ lines in hosts file (nor even several times that amount) on either Windows, FreeBSD nor Linux; and I certainly don't run powerful machines. But that aside I wasn't suggesting that people run dnsmasq on their primary workstation. It's certainly an option, but I personally think it's better to have dnsmasq on a spare machine which is always on (doesn't need to be beefy, a Raspberry Pi would easily be more than capable). That way you can plum your dnsmasq IP into your DHCP server (or even use dnsmasq as your DHCP server as well) so that your phones, tablets and other devices all also benefit from ad blocking / tracking / etc. Another option with dnsmasq is to run it directly on the router. Some consumer routers, such as Asus, allow you to access the device's command line via telnet / SSH. In the case of Asus, they literally just run dnsmasq for their DNS and DHCP daemons, so you could apply the hosts file directly on the router if you wished.
- creshal 11y ago> It's a lot less resource intensive not to use a hosts file. dnsmasq has the --addn-hosts parameter for that, so you can keep the list in a separate file.