Live data from Hacker News

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

github.com

31–40 of 97 posts

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

#31
post #14
post #12

Earlier quoted context omitted.

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

Indeed. Traffic served from 0.0.0.0 can be seen from other machines. Traffic on 127.0.0.1 or localhost cannot. Important to know when you’re doing local development vs a local demo.

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

#32
post #17
post #12

Earlier quoted context omitted.

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...

"if a 0.0.0.0 packet falls in a forest, will it make a sound a 0.0.0.0 listener can hear?"

your link was to an informative but still sloppily written article and in this context, your summary of the article isn't clarifying.

to write clearly, people gotta stop throwing around the word localhost because at the level of n.n.n.n there are no names, only numerical addresses and localhost is a name, one defined in a text file: 127.0.0.1 points to, not localhost, but to the local host, always; localhost (the name) points to 127.0.0.1 iff it is defined to (which should be all the time).

what I learned from the article is that a local host server listening on 0.0.0.0 will listen to everthing it can hear. But the question context here is, where will a packet sent to 0.0.0.0 go?

The point that 0.0.0.0 is not routable does not answer the question because 127.0.0.1 is also not routable; however, 127.0.0.1 will arrive someplace, at the local host. The question is whether 0.0.0.0 will also arrive into "the pool o' packets", that place that packets arrive on the local host prior to their disposition being determined (a. routed out of the local tcp/ip pool o' packets, b. listened to within the local tcp/ip pool o' packets, or c. dropped on the floor) because routing isn't only what Routers do, it's what tcp/ip does within a local host. (and btw, the article also describes that 0.0.0.0 means the default routing of last resort address in the context of a route address, also not the same as a packet destination address)

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

#33
post #9
post #6

Earlier quoted context omitted.

I also don't understand systemd integration in the todo.

The goal here is to make it automatically update the hosts file once in a while

If I considered constructing a botnet of Linux workstations, your software would be an excellent candidate.

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

#34
post #9

Earlier quoted context omitted.

The goal here is to make it automatically update the hosts file once in a while

If I considered constructing a botnet of Linux workstations, your software would be an excellent candidate.

You could say the same thing about Ansible, or Chef or Puppet or any of the other millions of systems automation tools available. There are lots of ways to misuse software, I don't think that that should preclude people from writing it.

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

#35

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…

Pie hole also has a nice browser interface to debug blocked requests that are breaking the site you don’t want To be broken. Which happens inevitably when you pull together 10 different sources of blocked lists.... or just one persons whose ideal blacklist doesn’t match yours.

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

#36
post #22
post #9

Earlier quoted context omitted.

The goal here is to make it automatically update the hosts file once in a while

Isn’t that what cron is for?

Systemd has a cron system too.

I’m just guessing, but it might be easier to programmatically install a systemd cron job (and making sure it runs) than doing so for the old/conventional crond?

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

#37

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

When the network goes down, it can take several minutes for it to come back up. I was having DNS and connectivity issues at a LAN party. Wouldn't get connectivity for minutes after a link bounce.

Then I removed the hosts file, and it worked instantly.

Maybe for a static workstation it wouldn't be bad, but for a laptop or something that loses link frequently, it could be an issue.

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

#39
post #38

Serious question. We all realize that the economics of the internet is largely fueled by ads, so why are we so keen to block them? It’s ad revenue that have allowed technology to flourish so strongly over the last two decades.

Not long ago, the economy was largely fueled by slavery. Yet we got rid of that.

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

#40
post #38

Serious question. We all realize that the economics of the internet is largely fueled by ads, so why are we so keen to block them? It’s ad revenue that have allowed technology to flourish so strongly over the last two decades.

You are partially right. There are ads that are truly useful and those which are malicious, such as popunders which often include scammy pops. I use adblock to prevent the latter. There are popunder ad networks which are trying to fight against adblock by introducing "solutions" like anti-adblock, see here: https://propellerads.com/blog/anti-adblock-3-monetize-99-per...

I side with the adblock solutions in this war.

Post reply on HN