Reverted ETP processing.

This commit is contained in:
Discsearcher
2026-08-12 09:29:34 -04:00
parent c873680830
commit 7929efabbf
+22 -21
View File
@@ -133,31 +133,32 @@ def perform_query(full_domain, ns, record_type, timeout):
results = []
response_rcode = r.rcode()
# Helper function to extract records of the requested type from a section
def extract_records_of_type(section, requested_type):
section_results = []
if section:
for rrset in section:
# Only include RRsets that match the requested record type
if rrset.rdtype == requested_type:
for item in rrset:
section_results.append(str(item))
return section_results
# Check answer section first
results = extract_records_of_type(r.answer, record_type)
if results:
return (full_domain, ns, results)
answers = r.answer
if answers:
for rrset in answers:
for item in rrset:
results.append(str(item))
if results:
return (full_domain, ns, results)
# If no answer, check additional section (some servers put records there)
results = extract_records_of_type(r.additional, record_type)
if results:
return (full_domain, ns, results)
additional = r.additional
if additional:
for rrset in additional:
for item in rrset:
results.append(str(item))
if results:
return (full_domain, ns, results)
# If still no results, check authority section (only for SOA, NS, etc.)
results = extract_records_of_type(r.authority, record_type)
if results:
return (full_domain, ns, results)
# If still no results, check authority section
authority = r.authority
if authority:
for rrset in authority:
for item in rrset:
results.append(str(item))
if results:
return (full_domain, ns, results)
# Truly no records found - check if there's a non-NOERROR response code to report
if response_rcode != 0: # 0 = NOERROR