LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 05-13-2006, 12:40 AM   #1
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Rep: Reputation: 0
how do you block access to a site?


I have slackware 10.2 working as my asterisk pbx and a router. I use dhcpd and iptables. I need to block access to myspace.com to save my bandwidth. Does anyone know how I would go about doing this?
 
Old 05-13-2006, 02:19 AM   #2
Jerre Cope
Member
 
Registered: Oct 2003
Location: Texas (central)
Distribution: ubuntu,Slackware,knoppix
Posts: 323

Rep: Reputation: 37
I would use a program like squid ( squid-cache.org ) as a proxy where you could easily filter by urls and save bandwidth by caching web access for your whole site. The simplest way to setup squid is with webmin (webmin.com)
 
Old 05-13-2006, 02:39 AM   #3
dugan
Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 5,006

Rep: Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560
Edit /etc/hosts and set www.myspace.com to 127.0.0.1.
 
Old 05-14-2006, 11:09 AM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
And myspace.com
& <every_other_host_at>.myspace.com

The problem is: the hosts file doesn't do wildcards, so you must track down & enumerate every offensive host at every blocked domain & put each one in a separate line in your hosts file. Not only that, when <blocked_domain>.<tld> adds a new server, you must discover it & add it.

Consider the HOSTS file from www.accs-net.com/hosts: http://www.accs-net.com/hosts/Downloads/hosts127001.zip
I grepped it for each of the domains that had a host "ad250", piping the result through wc -l, here the results:
Code:
hpg.ig.com.br     1065 
hpg.com.br         877 
ezcybersearch.com  269 
popupad.net        269 
erasercash.com     267 
paycount.com       266
(I know a guy whose hosts file runs over 30,000 entries! Of course, he is doing serious malware as well as ad blocking.)

You're much better off taking the proxy server suggestion or using DNS.

If you want to pursue using DNS, you might consider adding dnsmasq to your router. Besides being a small combo DHCP & DNS server, you can block whole domains w/ one simple line per entire domain in its config file.

If you already have Bind running, then see http://pgl.yoyo.org/adservers/ for information on how to get it to block domains.
are especially useful.
 
  


Reply

Tags
filter, squid, webmin


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
Is there a way to block people from accessing my site if they came from a certin url? abefroman Linux - Security 5 02-14-2006 12:16 AM
allow specific ip to browse the block site space_beyond Linux - Newbie 1 06-03-2005 10:15 AM
How I can block a IP to view my web site?? AZIMBD03 Linux - Networking 6 02-26-2004 04:19 PM
squid acl how to block all site except some mikmok Linux - Networking 1 12-22-2003 09:20 AM
block local user to access a site xen_chris Linux - Newbie 3 04-15-2003 10:55 AM


All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
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