Hello, it is possible to block the output of network traffic to a particular URL eg block the output to example.com or net1.example.com using firewalld or iptables in any case otherwise you could do this, I have managed to block The output to a particular port using firewalld rules with firewall-cmd but is not what I am looking for already blocking the output of http or https blocks all outputs in general
regards
Roberto García
Block outgoin by URL
Re: Block outgoin by URL
This is fairly easy to do with squid, a HTTP proxy. I use this myself at home to block the most annoying ads.
squid.conf:
bad-sites.acl:
Automagically redirecting the traffic to the proxy (see "transparent proxy" from your favourite search engine) might need some clever firewall rules, though. This is not a problem for myself, because I can simply point the single browser I use to the proxy.
squid.conf:
Code: Select all
acl bad_url dstdomain "/etc/squid/bad-sites.acl"
http_access deny bad_url
Code: Select all
.example.com
net1.example.com
www.someblockedsite.com