A Squid proxy server redirector replaces certain URLs with others. It can therefore be used as an ad-blocker. Speeding up page load speeds and reduce tracking. Here a list of Squid Related Redirectors Software.
This redirector matches URLs against entries in a file. It can match against
the beginning of an URL, the end of an URL and a substring of an URL.
It can also lookup host-names and IP addresses in DNS-based blacklists or RBLs.
Keep in mind that this will lead to false positives. Often there are many websites sharing the same IP address(es). Blacklisting a single IP address will block access to all of those sites. Including those which are not malicious.
Directory for conf files.
This is a OR of;
|2||If alias, check CNAME|
|4||Check IP address(es)|
|8||Log TXT record|
List of URLs not to fetch.
|http://ad.doubleclick.net/||Matches any URL that begins with 'http://ad.doubleclick.net/'.|
|ad.doubleclick.net||The same for HTTPS.|
|*count.gif||Matches any URL that ends in 'count.gif'.|
|*doubleclick*||Matches any URL that contains 'doubleclick'.|
Directory for log files. The directory has to be writable by the Squid process owner.
epoch.ms pid blocked_host_or_ip blacklist A lookup TXT
Before log-file rotation you need to reload Squid. This will kill the redirectors.
For TXT look-ups to work you need to remove the comments around '#define RSD_TXT_LKP 1'. If you do this you need to compile with -lresolv;
cc -O2 -Wall -lresolv -o rblsredir rblsredir.c
The maximum number of RBLs is eight. If you want more you need to increase the number next to '#define RSD_MAXLISTS'.
The Spamhaus DROP (Don't Route Or
Peer) list consists of a number of files in network/netmask format. They are
ment to be part of a firewall. You can however, convert them in a blacklist
zone file instead.
The stuff below does this for you;
You can add your own extries if you want.
malice.example.com IN A 127.0.0.2