It seems that with Unbound 1.10 we now have access to use RPZ (Reponse Policy Zones).
Lots of details here:
https://dnsrpz.info/
The short of it is, unbound can now take commands to redirect or block bad sites based on domain or based on IP which would be found. Very powerful, and may need to consider re-doing adblock based on this.
But for now, I wanted to see if this could be used to block bad sites (malware/phishing etc). So I played around with setting it up.
First you need to modify the module-config add respip:
Code:
module-config: "respip validator iterator"
Next you need to add in RPZ sections for the servers/services you want to use. Many are pay, but I tried out a base DROP list from Spamhaus. They describe why it is free as "The DROP list contains network ranges which can cause so much damage to internet users that Spamhaus provides it to all, free-of-charge, to help mitigate this damage."
So, to enable it, in a mode where it uses IXFR and AXFR to sync directly from the master, add this to your unbound.conf file:
Code:
rpz:
name: "drop.rpz.spamhaus.org"
master: 35.156.219.71
master: 34.194.195.25
zonefile: "/opt/var/lib/unbound/db.drop.rpz.spamhaus.org"
rpz-log: yes
rpz-log-name: "drop.rpz.spamhaus.org"
if you lookup the following test URL, you should see an item in the log:
Code:
drop.rpz.spamhaus.org.rpz-test.spamhaus.zone
log:
info: RPZ applied [drop.rpz.spamhaus] drop.rpz.spamhaus.org.rpz-test.spamhaus.zone. nxdomain ...
It seems hit and miss right now for getting it to work. Sometimes the file is downloaded, sometimes not.... still look at that.
Another config I am trying, but it isn't working yet is:
Code:
rpz:
name: rpz.urlhaus.abuse.ch
url: "http://urlhaus.abuse.ch/downloads/rpz/"
zonefile: "/opt/var/lib/unbound/db.rpz.urlhaus.abuse.ch"
rpz-log: yes
rpz-log-name: "rpz.urlhaus.abuse.ch"
rpz-action-override: nxdomain
If I download the file manually via wget on the router it works just fine, but isn't download it automatically. Also, https download isn't working.
Good article here:
https://medium.com/nlnetlabs/response-policy-zones-in-unbound-5d453de75f26