LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-01-2006, 12:02 AM   #1
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Rep: Reputation: 81
blocking websites


Is there any better way to block websites than using iptables? I would like to block all website's on the myspace server. I'd also like to block all instant messaging chatting from this computer. This computer is also running windows in VMware server, so I'd like to block myspace from being used from it too. If I use iptables to block myspace, it will block it from any web browser even if the web browser is IE6 running in VMware Server right? I got this ip using ping. How can I block all of it sending and coming to this computer?

Code:
ubuntu@ubuntu:~$ ping www.myspace.com
PING www.myspace.com (216.178.32.51) 56(84) bytes of data.
64 bytes from 216.178.32.51: icmp_seq=1 ttl=244 time=115 ms
64 bytes from 216.178.32.51: icmp_seq=2 ttl=244 time=156 ms

--- www.myspace.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1005ms
rtt min/avg/max/mdev = 115.457/136.140/156.823/20.683 ms
ubuntu@ubuntu:~$
 
Old 09-01-2006, 12:05 AM   #2
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
I believe you can include it in the host.deny file. It'll be completely banned.
 
Old 09-01-2006, 12:22 AM   #3
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Original Poster
Rep: Reputation: 81
I tried adding the ip to /etc/hosts.deny. I wasn't able to block www.myspace.com. Have you tried it?
 
Old 09-01-2006, 05:21 AM   #4
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Set up a proxy server like squid. The hosts.deny in /etc is actually for services on the computer that you want to deny access from certain people. The program have to support tcpwrappers in order for /etc/hosts.deny to work.
 
Old 09-01-2006, 09:17 AM   #5
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
No, I haven't try it, I do my blocks in the firewall. Don't you have a firewall before your box?
 
Old 09-01-2006, 10:45 AM   #6
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Original Poster
Rep: Reputation: 81
Quote:
Originally Posted by isuck@linux
No, I haven't try it, I do my blocks in the firewall. Don't you have a firewall before your box?
yes, iptables, but it's not very simple and user friendly, so i am asking for some help untill i get the hang of it. i figured out how to block myspace. this is how to do it.

Code:
echo "127.0.0.1  www.myspace.com" | sudo tee -a /etc/hosts
How can I block ports that specific programs use with servers on the internet? What is the iptables command to do that?
 
Old 09-01-2006, 05:27 PM   #7
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Again try using a proxy server like squid. You can block any site by its domain name (I think) and limit what content that a user can download. Setting up a web browser to use a proxy server is very easy.

Firestarter makes setting up IPTABLES a lot easier. There is also firewall builder.
 
Old 09-02-2006, 08:57 PM   #8
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Original Poster
Rep: Reputation: 81
Why load a computer down with a proxy server for such a simple task? I'm using dialup, don't have a spare computer to put squid proxy server on, and setting up a web browser to use a proxy server may be easy, but setting up the proxy server could be very time consuming and not so easy. Is firewall builder a script? I'd like to use something besides firestarter. Thanks for the information.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid problem ... blocking some websites rickyinman Linux - Networking 4 04-11-2006 01:26 PM
Blocking access to specific Websites and IP Ports fieldyweb Linux - Newbie 3 12-02-2005 06:32 AM
linblock blocking websites synaptical Linux - Software 3 09-08-2004 12:12 AM
Iptables blocking certain websites?? Ikik Linux - Security 3 09-29-2003 03:39 AM
Slackware blocking websites to lan? Astro Linux - Networking 14 07-20-2003 03:44 PM


All times are GMT -5. The time now is 04:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration