Table of Contents

Ubuntu - Squid - Block Websites

You can block websites from the proxy users, just create a separate file that will be the list of domains you want to block and point that file from the squid configuration,


Create a file to contain blocked websites

sudo touch /etc/squid/blocked

Then type all websites you want to block one per line in that file and save it.


Configure Squid to block Websites

Change the squid configuration to block those websites under acl list and http_access list.

/etc/squid/squid.conf
acl blocked_sites dstdomain "/etc/squid/blocked"
 
http_access deny blocked_sites

Restart Squid

sudo systemctl restart squid

There are a lot of ready to use lists on the web and they are categorized, you can use them in squid, like MESD blacklists, Shalla’s Blacklists.


References

http://www.squidguard.org/blacklists.html

http://www.shallalist.de/

https://dsi.ut-capitole.fr/documentations/cache/squidguard_en.html#contrib