From: Michael Tremer Date: Sat, 6 Dec 2025 20:46:55 +0000 (+0000) Subject: util: Allow blocking an entire TLD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad221a7d3e8c2cd90e8e787b36238bedb441cb8d;p=dbl.git util: Allow blocking an entire TLD Signed-off-by: Michael Tremer --- diff --git a/src/dnsbl/util.py b/src/dnsbl/util.py index 949130a..a418959 100644 --- a/src/dnsbl/util.py +++ b/src/dnsbl/util.py @@ -58,16 +58,12 @@ def is_fqdn(s): if len(s) > 253: return False - # Remove final dot, allowed in DNS but not in DB checks + # Remove final dot if s.endswith("."): s = s[:-1] labels = s.split(".") - # FQDN must have at least two labels (e.g., example.com) - if len(labels) < 2: - return False - for label in labels: if not 1 <= len(label) <= 63: return False