Live data from Hacker News

BeGoneAds – A Python script that blocks ads by installing common hosts files

github.com

11–20 of 97 posts

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#11

Anybody have a sense of the performance overhead of using hosts files versus a detached hardware solution like a pihole?

My understanding is that difference is in scope, not performance. Hosts files will only affect the host (workstation/desktop/laptop etc) they're installed on. Things like piHole try to make it easy to apply the solution to all members of your network - which even in household cases these days can number in dozens, making it impractical to manage hosts files for all of them (This includes items like phones which are t…

It would be nice to see a performance hit based on the number of hosts entries.

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#12
post #8

Since accepting Host files from someone on the internet can be dangerous I dug into the code: The list of hosts to exclude comes from several sites here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8... The actual application of the hosts file is here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8... I missed something though. Is a simple domain name per line enough to send that content…

This is actually sent to the IP address 0.0.0.0, it roughly means that all the traffic of the listed hosts is routed back to localhost

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#13
post #10

I get that this is just someone's side project, I'm glad it exists and they're free to write it in their favorite language/environment and all; but the effort to actually run this is equivalent to actually copying the hosts files manually, and I already have all the dependencies installed. I could never get my non-techy parents to run this properly. If the goal of the project is actual adoption, a native executable w…

This is a todo, It's already on PyPI and I'm working on getting it packaged for all the main distros of Linux/Windows and MacOS.

I saw the todo item, but didn't realize it also included providing an executable for Windows and macOS. Thanks!

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#14
post #12
post #8

Since accepting Host files from someone on the internet can be dangerous I dug into the code: The list of hosts to exclude comes from several sites here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8... The actual application of the hosts file is here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8... I missed something though. Is a simple domain name per line enough to send that content…

This is actually sent to the IP address 0.0.0.0, it roughly means that all the traffic of the listed hosts is routed back to localhost

0.0.0.0 ≠ localhost

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#15

Anybody have a sense of the performance overhead of using hosts files versus a detached hardware solution like a pihole?

I used one of the popular hosts files on my local machine for a while: the networking didn’t seem to suffer, but the boot time for my machine slowed noticeably. And manual updates were painful because loading the file in an editor is slow so if you use your hosts file for other reasons it can inhibit your workflow. I would recommend automated process on some dedicated device so you don’t impact your normal usage.

Another experience I had was that certain sites failed to work correctly. I didn’t do extensive testing but when I disabled the hosts nocking the sites worked, when I enabled it they broke. These were companies with whom I was trying to do account related business: so it wasn’t just that something didn’t render correctly it actively prevented me from updating my accounts when I tried to submit requests.

I still like the approach and will continue to use it, but it hasn’t been frictionless.

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#17
post #12
post #8

Since accepting Host files from someone on the internet can be dangerous I dug into the code: The list of hosts to exclude comes from several sites here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8... The actual application of the hosts file is here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8... I missed something though. Is a simple domain name per line enough to send that content…

This is actually sent to the IP address 0.0.0.0, it roughly means that all the traffic of the listed hosts is routed back to localhost

In this context, it actually means a "non-routable meta-address used to designate an invalid, unknown, or non-applicable target" [1] - 127.0.0.1 is localhost, 0.0.0.0 is its own thing.

[1]: https://www.howtogeek.com/225487/what-is-the-difference-betw...

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#18

Python scripts to modify system files make me a little skittish, even with source code available. I think I would just as soon grab the hosts file from https://www.someonewhocares.org/ and drop it in myself.

Why?
Post reply on HN