On Monday 31 August 2020 00:11:31 Stefan Krusche wrote:
Am Montag 31 August 2020 schrieb William Morder via trinity-users:
Okay, the hosts after 127.0.0.1 and 0.0.0.0 are (or ought to be) identical; I just looked at it, and they don't seem to match, although I thought that I had done it already.
In /etc/hosts IP adresses are assigned to domain names. The difference is if a domain name is being assigned 0.0.0.0 the request will be send to digital nirvana. If it is assigned 127.0.0.1 it will be served by localhost, if you have a web server running so you can see there has been something blocked/deviated. IIUC.
If you don't have a web server running to respond to these it doesn't make sense to use 127.0.0.1 in /etc/hosts to block domains because the system first tries to serve these requests before ending with an error… well, I don't know the exact mechanism, but you can save these computing cycles by using only 0.0.0.0 in /etc/hosts. Again, IIUC.
So far as "what has been added" by the present author, well, good luck there. I mostly recognize where my hand has touched, but others may not spot the tell. Mostly you can identify mine by how messy the entries are, especially because they tend to repeat elements in the address, e.g.:
0.0.0.0 fao.org 0.0.0.0 *.fao.org* 0.0.0.0 coml.org 0.0.0.0 *.coml.org* 0.0.0.0 nco-assets.s3.amazonaws.com 0.0.0.0 maxcdn.bootstrapcdn.com 0.0.0.0 *maxcdn* 0.0.0.0 *bootstrapcdn* (etc. ... trying to block unwanted elements on annoying pages).
I don't think you can use wildcards in /etc/hosts. That's why hosts-based blocklists are usually very, very big. See man hosts:
DESCRIPTION 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).
HTH
Kind regards, Stefan
Everybody is welcome to add to the list or modify or correct (although it would be nice if we all share common resources among ourselves). I don't claim that I know what I am doing here, or that I know why it works, although you explain more clearly what I have heard or read elsewhere.
I do know that I see a big difference between using a customized hosts file instead of (only) depending on ad-blockers. As soon as I overwrite the hosts file with my list, I find that my system is more stable. It's not only the ads that get blocked, it seems, but also other unwanted connections.
Bill
--------------------------------------------------------------------- To unsubscribe, e-mail: trinity-users-unsubscribe@lists.pearsoncomputing.net For additional commands, e-mail: trinity-users-help@lists.pearsoncomputing.net Read list messages on the web archive: http://trinity-users.pearsoncomputing.net/ Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting