Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to block websites for particular IPs by squid?

Please give solution with example or configuration file.

share|improve this question
up vote 6 down vote accepted

Example :

I blocked Facebook & orkut to all user but now i want to open only facebook to particular user or IP

Option 1 : Specify site with in configuration file,

acl special_clients src "/etc/squid/special_client_ips.txt"

acl facebook dstdomain

acl orkut dstdomain

Under http access

http_access allow facebook special_clients

http_access deny facebook

http_access deny orkut

http_access allow all

Option 2 : Stick both client IP s and destination domains into lists,

acl special_clients src "/etc/squid/special_client_ips.txt"

acl bad_domains dstdomain "/etc/squid/bad_domains.txt"

Under http access

http_access allow bad_domains special_clients

http_access deny bad_domains

http_access allow all

  • I get it from net, It work very well

  • Thanks cstamas

share|improve this answer

You need somthing like this:

acl BlockedHost src
http_access deny BlockedHost

The config file is well commented searching for the word acl will help you further.

Squid acl faq

share|improve this answer

protected by Tom O'Connor Jul 8 '14 at 10:08

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.