]> git.ipfire.org Git - dbl.git/commitdiff
checker: Accept empty responses
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Jan 2026 10:27:51 +0000 (10:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Jan 2026 10:27:51 +0000 (10:27 +0000)
When we are querying for something.example.org, we will get the SOA of
example.org. dnspython still considers this a NoAnswer, but actually
this is good enough to tell us that the domain is alive.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/checker.py

index 7c76026f347af00fdcc95939e8820931a7ad81f9..8bb8df2993dba42c85ca8a205b9e04091ff7d95b 100644 (file)
@@ -174,8 +174,8 @@ class Checker(object):
                except dns.resolver.NoAnswer as e:
                        response = e.response()
 
-                       # If we have received a CNAME, we will resolve again
                        if response:
+                               # If we have received a CNAME, we will resolve again
                                for rrset in response.answer:
                                        if rrset.rdtype == dns.rdatatype.CNAME:
                                                for record in rrset:
@@ -183,8 +183,9 @@ class Checker(object):
 
                                                        return self.submit(domain, hostname=hostname)
 
-                       # If there has been no response, we assume that the domain does not exist
-                       status = False
+                       # If we have received no response, that does mean that we might not
+                       # have found the root of the domain, but something at least responded.
+                       status = True
 
                # NXDOMAIN
                except dns.resolver.NXDOMAIN as e: