From 7929efabbf6e3f09a4f714d17a8e0d1e9e1b563ce0cecb8cba88cba31c7a4b49 Mon Sep 17 00:00:00 2001 From: Discsearcher Date: Wed, 12 Aug 2026 09:29:34 -0400 Subject: [PATCH] Reverted ETP processing. --- dns_compare.py | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/dns_compare.py b/dns_compare.py index 6cbd751..8a78778 100755 --- a/dns_compare.py +++ b/dns_compare.py @@ -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