Wednesday, November 19, 2008

Howto Block websites using Squid Proxy in Ubuntu Linux

You can block websites using squid proxy with 3 easy steps. First you have to create a text file with blocked domain name list such as orkut.com, gmail.com, sex.com, yahoo.com and so on. Second define and Access Control List (ACL). Third and final step Restart Squid.

First, create a file called /etc/squid/blocked.domains.acl (any file name you can use)
# cd /etc/squid
# vi blocked.domains.acl

add domain names in the file ,

eg:
orkut.com
gmail.com
sex.com
yahoo.com

Save and close the file.

Open /etc/squid/squid.conf file:

# vi /etc/squid/squid.conf

Create acl called blockeddomain

acl blockeddomain dstdomain "/etc/squid/blocked.domains.acl"

Deny http access, enter

http_access deny blockeddomain

Close and save the file. Restart squid proxy server

# /etc/init.d/squid restart

3 comments:

bornfree said...

sure it can block of http sites... what about https sites?

Anonymous said...

Cool blog as for me. It would be great to read a bit more concerning that topic. The only thing it would also be great to see on this blog is a few pictures of some devices.
Alex Watcerson
Cell phone jammers

Tech support said...

in the blocked.domains.acl file the format of the url should be like this
Ex: .facebook.com

not http://www.facebook.com