I solved this problem on my own but I thought that others might find it useful. I was not able to find this answer anywhere else on the web.
If you are using your hosts file to redirect unwanted sites to your own computer but you find that the sites are not being blocked even from a ping. The solution is probably that you overwrote the hosts file in stead of appending to it. I did this and it removed the ipv6 localhost info. Once this was gone, the hosts file would not redirect any traffic. Linux ignored the hosts file untill I replaced this line.
::1 localhost
I don't know why missing the ipv6 localhost info has this effect. If anyone does it would be nice if you could reply below.
In any case, make sure you append blocked sites to your hosts file. Do not overwrite it. The minimum info to make it would correctly will look like this:
-------------
127.0.0.1 localhost
::1 localhost
0.0.0.0 site.youwanttoblock.com
Using hosts file to block unwanted sites - failing to block
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Re: Using hosts file to block unwanted sites - failing to bl
To reply massively late:
- thanks;
- this page, on adding an adblocking hosts file, is useful: https://delightlylinux.wordpress.com/20 ... osts-file/
- thanks;
- this page, on adding an adblocking hosts file, is useful: https://delightlylinux.wordpress.com/20 ... osts-file/