The code does lookups against ZRD and DBL for subdomains rather than the domain name itself, causing unnecessary extra queries.
In addition, the code compares subdomains to $skip_domains, instead of comparing the domain name. This results in unnecessary ZRD and DBL queries for "sub.example.com..." even if example.com is in skip_domains.
Fix these problems:
The code does lookups against ZRD and DBL for subdomains rather than the domain name itself, causing unnecessary extra queries.
In addition, the code compares subdomains to $skip_domains, instead of comparing the domain name. This results in unnecessary ZRD and DBL queries for "sub.example.com..." even if example.com is in skip_domains.
(This is a replacement for https://github.com/spamhaus/spamassassin-dqs/pull/31, in which I wrongly included an additional change.)