Thanks, this is all massively appreciated.
Now that I've had chance to look over all of the above, am I right in thinking that:
- your scripts basically convert a file of domains in to their corrosponding IP's to then be added to a DNSBL as per your original replies. So for example google.com would convert to 216.58.206.78 so your script would determine that the entry to add to the DNSBL would then be 78.206.58.216.dnsbl.qweb.co.uk
Exactly.
And if you want to block 216.58.206.0/24 the record *.206.58.216.dnsbl.qweb.co.uk will be created.
Now it may become clear why the IP is in reverse order.
It makes it possible to "abuse" the wildcard mechanism for whole subnets.
You can fill it with /32, /24, /16 and /8 addresses.
If it finds other subnets in your file they will be represented by multiple entries in DNS
- I'd then add this entry as an A record with a corresponding TXT record, to the qweb.co.uk DNS.
No, you don't need a corresponding TXT-record for each entry. Only each response (127.0.0.2 for instance) could do with a TXT-record. That's why you will not see any TXT-records created by my script. Only A-records.
- Provided dnsbl.qweb.co.uk is then added to Plesk as a blacklist service, email from @google.com would then be blocked because the above A record exists.
Exactly.. If it doesn't get an answer, it's good.
If this is correct then I think I follow everything you're doing here =).
My only concern with this approach though, is that where multiple domains share a single IP address, blocking one of those domains will effectively block them all.
More often it's a server you want to block. Often complete subnets.
I suppose that's where URIBL has the advantage but then I'd need to modify the Postfix configurations manually rather than being able to use built-in Plesk functionality?
Yes, that's where the URIBL comes in.
BTW... this can also be used for whitelisting (IP's and URI's)
I take it with that approach, there's be the risk of Plesk overwriting the amended configs on occasion too.
You need to monitor that anyhow.
I have a script that runs every hour and checks several folders. If it detects a change it will tar the folder to a file with a datestamp. This way you can always detect a change.
It's not the end of the world if it loses this.
Plesk doesn't rewrite the config as often as it did and it will now leave some modifications as is. Because it's an added line instead of a changed line it has a better chance for surviving.
I think it will stick...
[EDIT] It's not an added line, but a changed line... (it's been some weeks now). But like I said.... Plesk is not as aggressive as it used to be.