Reverted ETP processing.

This commit is contained in:
Discsearcher
2026-08-12 09:29:34 -04:00
parent c873680830
commit 7929efabbf
+16 -15
View File
@@ -133,29 +133,30 @@ def perform_query(full_domain, ns, record_type, timeout):
results = [] results = []
response_rcode = r.rcode() 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 # Check answer section first
results = extract_records_of_type(r.answer, record_type) answers = r.answer
if answers:
for rrset in answers:
for item in rrset:
results.append(str(item))
if results: if results:
return (full_domain, ns, results) return (full_domain, ns, results)
# If no answer, check additional section (some servers put records there) # If no answer, check additional section (some servers put records there)
results = extract_records_of_type(r.additional, record_type) additional = r.additional
if additional:
for rrset in additional:
for item in rrset:
results.append(str(item))
if results: if results:
return (full_domain, ns, results) return (full_domain, ns, results)
# If still no results, check authority section (only for SOA, NS, etc.) # If still no results, check authority section
results = extract_records_of_type(r.authority, record_type) authority = r.authority
if authority:
for rrset in authority:
for item in rrset:
results.append(str(item))
if results: if results:
return (full_domain, ns, results) return (full_domain, ns, results)