blocking specific websites, but allowing internet access
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
blocking specific websites, but allowing internet access
hi, i have a machine that i would like to be able to block access to certain websites on (per user or machine wide will work) but i still want to allow access to all of the internet.
I'm going to try using IPtables when I get the chances, something like
IPTABLES -A OUTPUT -d hotmail.com -reject-with icmp-host-unreachable
I've searched this site, and someone posted the iptables method, but I have never actually tried it. If it works, I'm going to use a blacklist of websites and create a script to block more than 200 sites.
Last edited by musicman_ace; 12-04-2004 at 03:27 AM.
thanks for the help, but i have tried that, it does not seem to work, what do i need to do to make it take effect? (i typed everything correctly, i promise)
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
ALL:ALL
Originally posted by poiuytrewq thanks for the help, but i have tried that, it does not seem to work, what do i need to do to make it take effect? (i typed everything correctly, i promise)
Yeah....hosts.deny won't have any effect....you want to edit /etc/hosts as was illustrated previously. Just point the blocked site to the loopback addy, and save the file.
In some cases, I've run into situations where I have to enter multiple permutations of the site name (subdomains, etc) to get the desired effect. You don't have to do anything but save the file, and it'll be in effect immediately.
Such is life with kids in the house. and my hosts file passed 300KB in size a while back.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.