I am using squid server in my Debian server, I want to block some websites in my system and I followed all the procedures for this but there is no result.

share|improve this question
up vote 16 down vote accepted

You have to do some changes in squid.conf and here are the steps:

  • open this file /etc/squid3/squid.conf

  • add these lines:

    acl bad_url dstdomain "/etc/squid3/bad-sites.acl"
    http_access deny bad_url
    
  • then go to /etc/squid3/bad-sites.acl and add domains with this format

    .google.com
    .msn.com
    .app.facebook.com
    
share|improve this answer
3  
Adding the rules at the end of squid.conf file won't work. Add at appropriate position. Look for message like "INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS" – Habeeb Perwad Apr 22 '15 at 10:20
    
Just a note: .google.com also blocks google.com. Don't try to add both, or squid gives an error. – tuomassalo Sep 2 '16 at 8:48

You can also do by following changes in squid.conf

acl toblock dstdomain .facebook.com .google.com
http_access deny toblock

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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