hosts redirect resisted by Centos 7

General support questions
Post Reply
avraamjack
Posts: 26
Joined: 2012/06/29 00:22:12
Location: Portsmouth,Va USA

hosts redirect resisted by Centos 7

Post by avraamjack » 2014/10/09 23:41:12

Hi All,

Host redirect seems to be resisted by Centos 7.

One of the ways I block access to annoying sites is I put them in /etc/hosts with an IP address that is inaccurate.

This works great in 6, not so in 7.

I modified nsswitch.conf to try to restore the functionality, by adding [SUCCESS=return] on the files line after hosts line after files. No luck.

I vaguely remember resign something about how this might be different in 7, but the details escape me.


Avraam J. Dectis

avraamjack
Posts: 26
Joined: 2012/06/29 00:22:12
Location: Portsmouth,Va USA

Re: hosts redirect resisted by Centos 7

Post by avraamjack » 2014/10/15 13:17:34

Hi All,

Seems like the main difference here between 6 and 7 is that when you redirect to hosts you have to use an ip address that will not resolve to an actual server anywhere.

Before I was using an ip address for the redirect that was an actual server, it worked fine.

Now, maybe, when you do that it possibly checks the certificate and if they do not match it goes to dns? Interestingly it uses dns in this situation even of nsswitch.conf only lists files as an option and nothing else.

So I switched the redirect to 127.0.0.2 and now those sites are blocked again.

I try not to get click baited more than once.

Jack

Post Reply

Return to “CentOS 7 - General Support”