Thank you. My suggestion would be:
1) add a global option in pfBlockerNG for blocking entire domains where a DNSBL includes say abcdef.com (I think it has to be global option rather than per list, otherwise you run into trouble on de-duping as you say)
2) do the combination/de-duping/suppression etc as per normal (so people can override the global behaviour on a per domain basis by suppressing e.g. abcdef.com, but adding ads.abcdef.com)
3) at the point where pfBlockerNG translates the de-duped list into a conf file to pass to Unbound, check each domain being added:
- if it is a domain: then add it into the conf file with a local zone too - i.e. block the lot
- if it is a subdomain: then add it into the conf file with just a local data entry - i.e. just block the particular subdomain mentioned
I suspect you may need to build a list of top level domains into pfBlockerNG to do the last part. You can't just count dots unfortunately, as abc.co.uk has two (but is still a domain), whereas abc.com only has one.
On the crashing point, one way to deal with that is to sort the de-duped list by domain (e.g. invert the character order of each domain string, then sort, then invert back). Then when you apply the logic in (3), what you'll get is one zone redirect per domain, followed by all the data entries pertaining to that domain - hence no crash.
Just a thought as to how you might do it - I suspect it might be a bit more complicated!
Good luck, and thank you!
Andrew