Adding to the /etc/hosts file <resolved>

Message
Author
Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file <resolved>

#21 Post by Bierhundt »

@ skidooo - I copy them out as I see them come up on my you-tube videos. If they still don't disappear, I don't know how to make it different - any help would be appreciated!

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file

#22 Post by Bierhundt »

JeffA wrote: Thu Feb 14, 2019 6:14 pm
Bierhundt wrote: Mon Jan 28, 2019 9:22 pm
I've checked off all of the five that antix advert listed, as well I added the ones that someonewhocares offered on their site. I corrected one on my list on pg 1, should be donaldjtrump,com (I missed the 'j' the first time around), and have found 5 more ....

127.0.0.1 cbs.com/all-access/
127.0.0.1 rhodesbakenserv.com
127.0.0.1 www.rockauto.com
127.0.0.1 metacrawler.com
127.0.0.1 tempurpedic.com

I'll keep adding as I find more, since I surf a lot of You Tube for brew videos and recipes, and News sites, as well as homebrew blogs, homebrew suppliers and web sites.
I only see four listed on my advert-block (mvps, someonewhocares, yoyo, and adservers). The fifth line is "UNBLOCK" on mine, which I take to mean would undo the other lists so that they're not blocking anything.

So if I'm correct, it's counter productive to mark all lists, and then mark to have them unblocked, at the same time. Or am I missing something?
I think if you look closer, it's UBLOCK, not UNBLOCK. I made the same misteak myself IIRC. That said, I will go back and check!
.... Yep, take a look at Stevo's post on pg 1 - it's UBLOCK! My response to him .... I read that too fast and thoght it was UN-block! :>)

JeffA
Posts: 173
Joined: Wed May 16, 2018 7:59 pm

Re: Adding to the /etc/hosts file

#23 Post by JeffA »

Bierhundt wrote: Sun Feb 17, 2019 10:31 pm
I think if you look closer, it's UBLOCK, not UNBLOCK. I made the same misteak myself IIRC. That said, I will go back and check!
.... Yep, take a look at Stevo's post on pg 1 - it's UBLOCK! My response to him .... I read that too fast and thoght it was UN-block! :>)
I took a closer look, it is clearly "UNBLOCK", all caps with an N. Just to be sure, I checked only it and ran it, and it said it was "Restoring original /etc/hosts", and when I checked, sure enough all the blocked items in the host file that the other lists had added had disappeared.

Maybe if you try checking any or all lists except UNBLOCK, you won't have to keep adding so many things manually.

skidoo
Posts: 753
Joined: Tue Sep 22, 2015 6:56 pm

Re: Adding to the /etc/hosts file <resolved>

#24 Post by skidoo »

any help would be appreciated
In some contexts, folks will (correctly) say "ebay.com" and "cbs.com" are internet domain names.
In the context of the HOSTS file, those are hostnames of internet-connected webservers.

skidoo wrote: Thu Feb 14, 2019 8:23 pm 127.0.0.1 cbs.com/all-access/
127.0.0.1 www.youtube.com/yt/advertise
Above, neither of the 2 lines is exactly equal to a "hostname". They are "URLs" or "URIs" or "URL fragments" (each contains a hostname PLUS a path).
HOSTS cannot deal with pathstrings. Any line not containing a valid hostname string will likely be discarded/ignored when the HOSTS file is parsed.
Everything after the slash is meaningful only to the web browser and the webserver; nameservers (and DNS resolvers) never even see this part.
pssssst, check your list sources. One or more of 'em is sending CORRUPT (malformed) entries
man hosts

This manual page describes the format of the /etc/hosts file. This file is a simple text file that associates IP addresses with hostnames, one line per
IP address. For each host a single line should be present with the following information:

IP_address canonical_hostname [aliases...]

Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a comment, and is ignored. Host names may contain only alphanumeric characters, minus signs ("-"), and periods ("."). They must begin with an alphabetic character and end with an alphanumeric character. Optional aliases provide for name changes, alternate spellings, shorter hostnames, or generic hostnames (for example, localhost).
Blocking via HOSTS file is non-ideal. Every line within it serves to redirect (or block) exactly one -- one EXACT -- hostname.
Wildcard patterns ala "*.bestviagra.co.uk" are not possible, are not valid, within the HOSTS file.
Further, a line within the HOSTS file stating ebay.com very possibly may NOT block the hostname www.ebay.com
( the destination site may, or might not, 302 redirect//forward all received www. requests to "ebay.com" )(or to "ebay.co.uk")
( and, redirect or not is at their discretion. They may do it today, and again tomorrow, but not 6pm-12pm tonight )

...nor ww2.ebay.com, nor partnerads19.ebay.com nor bootietracker.ebay.com
^------- each of these is a distinct, separate, hostname
.
If you're motivated to grow beyond collecting curated blocklists and stuffing 'em into HOSTS, toward achieving "good enough"
or "covers most of the common offenders" blocking...

...check out the more granular, more flexible, pattern matching available by utilizing dnsmasq and/or tinyproxy (headers mgmt), or bind9
(all of these are available via apt-get from the stock debian repository)

JeffA
Posts: 173
Joined: Wed May 16, 2018 7:59 pm

Re: Adding to the /etc/hosts file <resolved>

#25 Post by JeffA »

Out of curiosity I did a little more checking. When you rerun Advert-Block, you need to check all the lists you want to reload. For instance if you have all four lists loaded, but only check one list when you run Advert-Block, it appears it will delete the other lists and just reactivate the one you have checked. However, if you don't check any lists, and rerun it, it will leave the hosts file unchanged with all the previous lists that were activated unchanged. Checking UNBLOCK (and only UNBLOCK) will remove all lists Advert-Block has added. It appears if you have one or more lists checked along with UNBLOCK, the UNBLOCK is ignored.

Obviously UNBLOCK is a purposeful and useful setting, so that there is an easy way to undo changes that Advert-Block made to the hosts file. It would seem to be in all caps to call attention to the fact that it is there to undo lists, and it helps differentiate it from the lists.
Bierhundt wrote: Sun Feb 17, 2019 10:31 pm I think if you look closer, it's UBLOCK, not UNBLOCK. I made the same misteak myself IIRC.
It seems to be another case of "I once made a mistake when I thought I had made a mistake" type of thing. :happy:

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file <resolved>

#26 Post by Bierhundt »

@ skidoo - Thanks all for the updates - now I've gotta go back and correct a bunch of pathstrings/URls. I wondered why some of them kept coming back up, now I think I know why! I've gone over my whole /etc/hosts file and got rid ov any info from the slash onward, as well as my posts in this thread - hopefully that takes care of it all!
If you're motivated to grow beyond collecting curated blocklists and stuffing 'em into HOSTS, toward achieving "good enough"
or "covers most of the common offenders" blocking...

...check out the more granular, more flexible, pattern matching available by utilizing dnsmasq and/or tinyproxy (headers mgmt), or bind9
(all of these are available via apt-get from the stock debian repository)
I dont' know what those are, but I'll take a look-see! Thanks

@ JeffA - I'll check the UBLOCK/UNBLOCK again - I may have made a mistake ....... again! THANKS!!

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file <resolved>

#27 Post by Bierhundt »

@ JeffA - Yep! You're right, I made a mistake ........ again! Now it's corrected!

FWIW, I had thought that every time I did an auto-upgrade, the antiX advert-block would also update .... I was unaware that I needed to update it every so often - how often is a new question I have. I'll try to update it every week IF I can remember :)!

I've noticed, that by removing all of the pathstrings/URLs as skidoo suggested, I'm getting a few more of those ads on you-tube that I thought I had gotten rid of. Also, I found that getting rid of those shut me out of the websites (like You-Tube), so I had to take them completely out of the /etc/hosts. I guess there's no way to win against these advertisements! I have all of the antiX advert-blocks checked as well, but still get many adverts - I've still got to research the things that skidoo mentioned "dnsmasq, tinyproxy, bind9" it may be too technical for me so it will take me some time to do that research.

JeffA
Posts: 173
Joined: Wed May 16, 2018 7:59 pm

Re: Adding to the /etc/hosts file <resolved>

#28 Post by JeffA »

I don't know either, but my guess is that updating weekly would be reasonable and adequate, unless maybe you suddenly start seeing more ads before the week is up.

I do realize now from my checking that when you update one you have to update all the lists you want to keep, because from what I saw, if you just check one box, it will update that list and remove the others.

So far I seem to be having better luck. I was using uBlock, but have disabled it to try out the hosts files list, and so far have seen little difference. I have noted a couple of place-holders, I guess you could call them, where ads would be that I think uBlock must clean up better so I don't notice them, but nothing really intrusive.

Even with uBlock, there are sites I'll start looking at, and then a box will pop-up asking me to subscribe or something or other that I have to X out of if I want to continue reading. That seems to be the biggest problem I've had with ads.

I haven't watched enough YouTube and such to get a feel how it compares to uBlock, but otherwise I haven't really missed uBlock, but I still have it on my browser ready to enable it if I start having problems.

I haven't checked out those other things Skidoo mentioned either. I'm afraid I might start getting back into my Windows mindset, constantly installing and tweaking all kinds of filters and blockers without ever fully understanding what I'm doing.

Bierhundt
Posts: 186
Joined: Wed Jan 31, 2018 12:12 pm

Re: Adding to the /etc/hosts file <resolved>

#29 Post by Bierhundt »

I haven't checked out those other things Skidoo mentioned either. I'm afraid I might start getting back into my Windows mindset, constantly installing and tweaking all kinds of filters and blockers without ever fully understanding what I'm doing.
:)!

Post Reply

Return to “General”