View Full Version : [ubuntu] how to block website on ubuntu using squid proxy

April 20th, 2009, 03:05 PM
hello sir/madam/gurus

i am beginner to linux and trying to learn it.

i made 1 testing server of ubuntu 9.04, where i install configure using squid proxy server.

I need to blocked the websites and ips, domains, subdomains. also download.

so i read so many article guideline but i could not success.

can some one guideline step by step how to do it.

i create one file, then block access and acl list define the file also, restart squid. but sites are not getting blocked.

what happend next, how it looks like if the site are blocked.

can some one also guide, if a few number of sites say like playboy.com,gmail.com to block, and a huge list of sites to block.

kind regards

April 20th, 2009, 03:45 PM
http://ubuntuforums.org/showthread.php?t=320733 is a very good howto on the subject.

April 21st, 2009, 02:49 PM
dear gurus

thanks for support this link

but this is using third party software filter content programs

anyway inside squid proxy where we can blocked ips/websites etc

advise further


April 21st, 2009, 02:55 PM
hello sir

can you advise which file to edit and put below details

filterip =
filterport = 8080
proxyip =
proxyport = 3128

April 21st, 2009, 09:12 PM
see here for an example of using whitelists and blacklists

basically, you need in /etc/squid/squid.conf

acl localnet src #define localnet
acl blacklist dstdomain "/etc/squid/blacklist" #define blaclist

http_access deny blacklist
http_access allow localnet

in /etc/squid/blacklist, you list the domains you want to block, starting with '.' to include hostnames/subdomains :


and so on

Note that filtering through a proxy server only works if the browser is configured to use the proxy, and that direct access to the internet is blocked or the user is prevented from modifying the proxy settings of the browser(s)