Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-04-2004, 04:08 AM
|
#1
|
Member
Registered: Jul 2004
Posts: 107
Rep:
|
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.
is there an easy way to do this?
using:
fedora core 2
firefox 1.0-1
|
|
|
12-04-2004, 04:24 AM
|
#2
|
Senior Member
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555
Rep:
|
set the site in the hosts file to be spoofed
127.0.0.1 blockedsite.com
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 04:27 AM.
|
|
|
12-04-2004, 04:35 AM
|
#3
|
Member
Registered: Jul 2004
Posts: 107
Original Poster
Rep:
|
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)
|
|
|
12-04-2004, 04:42 AM
|
#4
|
Member
Registered: Jul 2004
Posts: 107
Original Poster
Rep:
|
this for instace:
Code:
#
# 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
had no effect
|
|
|
12-04-2004, 05:50 AM
|
#5
|
Senior Member
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555
Rep:
|
Put squid on the firewall/gateway and do content filtering through squid
|
|
|
12-04-2004, 08:00 PM
|
#6
|
LQ Newbie
Registered: Aug 2003
Location: Long Beach, CA - USA
Distribution: Too many to count...
Posts: 28
Rep:
|
Quote:
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.
Last edited by EnigmaOne; 12-04-2004 at 10:47 PM.
|
|
|
09-01-2006, 12:45 AM
|
#7
|
Senior Member
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495
Rep:
|
What am I doing wrong? I haven't been able to block any websites.
Code:
ubuntu@ubuntu:~$ IPTABLES -A OUTPUT -d hotmail.com -reject-with icmp-host-unreachable
bash: IPTABLES: command not found
ubuntu@ubuntu:~$ iptables -A OUTPUT -d hotmail.com -reject-with icmp-host-unreachable
iptables v1.3.3: Unknown arg `hotmail.com'
Try `iptables -h' or 'iptables --help' for more information.
ubuntu@ubuntu:~$
|
|
|
All times are GMT -5. The time now is 08:03 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|