0

I want to make a bunch of websites unaccessible on my computer.

My hosts.allow file:

sendmail: all
# /etc/hosts.allow: list of hosts that are allowed to access the system.
#                   See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.

My hosts.deny file:

# /etc/hosts.deny: list of hosts that are allowed to access the system.
#                  See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: some.host.name, .some.domain
#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.
#
# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID

ALL: .vk.com
ALL: .ria.ru
ALL: facebook.com

My hosts file:

127.0.0.1   localhost
127.0.0.1:82 testsecond
127.0.1.1   shc
127.0.2.2:81  someth.com
127.0.2.2:83 test

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe02::1 ip6-allnodes
fe02::2 ip6-allrouters

I do follow all recommendations about settings hosts* files and I still CAN access them. I must do something really stupid or wrong.

For me it looks like they are just ignored.

3

hosts.deny is for servers, not clients running on your computer therefore you can't block websites with it. I suggest reading the hosts_access(5) man page for your system (Debian version, FreeBSD version).

By the way, there's a proposal by Lennart Poettering to get rid of tcpwrappers/tcpd in Fedora and OpenSSH will do the same.

  • this is pretty not fair that it's not possible to use these files! so much time were wasted! Possible usage of /etc/hosts makes it even more confused – Tebe Aug 9 '14 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.