Live data from Hacker News

Block Adware and Malware with /etc/hosts

github.com

21–30 of 79 posts

Re: Block Adware and Malware with /etc/hosts

#21
post #18
post #7

To ensure there are no nefarious redirects in such a massive list, this one-liner comes in handy[1]: grep -v '#' steves_hosts | awk '{print $1}'| sort | uniq -c [1] https://news.ycombinator.com/item?id=11456562

Someone explicitly called out and removed the Useless Use of cat but yet left the Useless Uses of grep, sort, and uniq in, I see. (-: * https://porkmail.org/era/unix/award#grep awk '!/#/ { seen[$1]++; } END { for (k in seen) { print seen[k],k; } }' steves_hosts

I'd rather have the readability of the first command than the "efficiency" of your example.

Re: Block Adware and Malware with /etc/hosts

#22

This is the default list used by the pihole project as well; it's a very good list. FWIW, something like ublock origin is going to be better for in-browser blocking (for example, DNS poisoning won't work with youtube ads, which are served from youtube.com, but addins like UBO can remove them because they can hook into the actual traffic). The ultimate adblocking solution is to use UBO in your browsers AND spin up a p…

Pi-Hole and PiVPN [0] is a great setup for DNS filtering on-the-go. The setup for PiVPN makes it foolproof as well.

When my Pi stopped working and I couldn’t find a new one, I gave up and moved to NextDNS [1] and have been very happy.

[0] https://www.pivpn.io/ [1] https://nextdns.io/

Re: Block Adware and Malware with /etc/hosts

#23
post #18
post #7

To ensure there are no nefarious redirects in such a massive list, this one-liner comes in handy[1]: grep -v '#' steves_hosts | awk '{print $1}'| sort | uniq -c [1] https://news.ycombinator.com/item?id=11456562

Someone explicitly called out and removed the Useless Use of cat but yet left the Useless Uses of grep, sort, and uniq in, I see. (-: * https://porkmail.org/era/unix/award#grep awk '!/#/ { seen[$1]++; } END { for (k in seen) { print seen[k],k; } }' steves_hosts

Guilty as charged!

Re: Block Adware and Malware with /etc/hosts

#24
post #20
post #12

Earlier quoted context omitted.

pi-hole also makes it super easy to block .zip and .mov TLDs.

Don't forget .com which is executable extension.

I'm not worried about the non-techies being tricked into thinking .com is an executable, I doubt they even know its possible. They almost certainly know about .zips

Re: Block Adware and Malware with /etc/hosts

#25
On the Mac the new Little Snitch Mini is really nice for this:

https://www.obdev.at/products/littlesnitch-mini/index.html

Sure, you could manage /etc/hosts manually, but Little Snitch Mini has a nice interface for managing blocklists, auto-updates them, and has nice visualization, and you can also manage blocks per app.

Re: Block Adware and Malware with /etc/hosts

#26
Does anyone have any updates on Mike Burgess (from winhelp2002.mvps.org)? He used to keep my go-to hosts file, but his health seems to have declined in the last few years. I would like to know if he is still around and if there is currently any method to donate or support him. Any news would be greatly appreciated.

Re: Block Adware and Malware with /etc/hosts

#27
post #18
post #7

To ensure there are no nefarious redirects in such a massive list, this one-liner comes in handy[1]: grep -v '#' steves_hosts | awk '{print $1}'| sort | uniq -c [1] https://news.ycombinator.com/item?id=11456562

Someone explicitly called out and removed the Useless Use of cat but yet left the Useless Uses of grep, sort, and uniq in, I see. (-: * https://porkmail.org/era/unix/award#grep awk '!/#/ { seen[$1]++; } END { for (k in seen) { print seen[k],k; } }' steves_hosts

I love awk as much as the next person and I've written some pretty large scripts with it, but the original grep/sort/uniq is a lot easier to understand in two seconds. I don't think it's "useless" at all.

Also your awk isn't exactly identical as it's not sorted, but in this case that probably doesn't matter.

Re: Block Adware and Malware with /etc/hosts

#28
I used to use this hosts file some years ago: https://someonewhocares.org/hosts/

Forgot about it for a few years, but this post jogged my memory.

We currently use a PiHole for house-wide, network-wide ad and telemetry blocking, though, but perhaps that hosts list is useful to someone else.

Re: Block Adware and Malware with /etc/hosts

#29

Reminds me of SlashDot where there was a relatively well known submitter that was a huge proponent of host-based ad blocking on Windows and was also a proponent of getting very angry at almost anyone else. (Edit: typo)

heh I made the mistake of engaging with that once. oh boy....

They could not wrap their head around the idea that the hosts method is limited in some use cases.

This could not be blocked without blocking the main host too. https://example.com/adverts-folder/advert.jpg

Now it sort of works in practice as most of the advert networks do not host on the same domain.

It is good at catching out whole bad domains but partial ones it is not very good at. Which some domains will do using a reverse proxy.

Also at one point a hosts file was linear scan. No sort of hashing or binary search lookup. Not sure if that was ever fixed in windows or linux. So a small number of hosts it was ok. But as the file grows it starts to add up.

Re: Block Adware and Malware with /etc/hosts

#30
It's almost the 40th anniversary of RFC 882. Back when the Domain Name System was being invented as the replacement for everyone sharing hosts files, I wonder whether anyone expected that 40 years later there'd be a shared hosts file with its own copyright licence, Docker file, and code of conduct.

Interestingly, from what I remember of the April Fools columns of electronics magazines of the time, one thing that people would not have been surprised by is that the purpose was zapping advertisements.

* https://worldradiohistory.com/UK/Electronics-Today-UK/80s/El...

Post reply on HN