Fix IPv6 Spamhaus lookup to use nibble-reversed format (#2617)

IPv6 Spamhaus check always reports "not blacklisted"
The IPv6 blocklist check in `management/status_checks.py` builds the DNSBL query name by reversing the 16-bit groups of the address instead of reversing individual nibbles.
The malformed name returns NXDOMAIN, which  evaluate_spamhaus_lookup()` treats as "not blacklisted," so the IPv6 check always passes regardless of actual listing status.
DNSBLs (including Spamhaus) expect nibble-reversed format.
This fix presents it in the correct nibble-reversed format.
This commit is contained in:
N9ZL authored and GitHub committed 2026-11-08 12:56:05 -05:00
1 parent 8c032705ae
commit b71c2e1ca6
1 file changed
+1 -1
+1 -1
View File
@@ -325,7 +325,7 @@ def run_network_checks(env, output):
from ipaddress import IPv6Address
rev_ip6 = ".".join(reversed(IPv6Address(env['PUBLIC_IPV6']).exploded.split(':')))
rev_ip6 = ".".join(reversed(IPv6Address(env['PUBLIC_IPV6']).exploded.replace(':', '')))
zen = query_dns(rev_ip6+'.zen.spamhaus.org', 'A', nxdomain=None)
evaluate_spamhaus_lookup(env['PUBLIC_IPV6'], 'IPv6', rev_ip6, output, zen)