fix(dns): address possible IndexError

This commit is contained in:
missytake
2026-05-07 15:08:02 +02:00
committed by holger krekel
parent c3e65147ba
commit fb322fde2d

View File

@@ -72,7 +72,7 @@ def get_authoritative_ns(domain):
f"dig -r -q {domain} -t NS +noall +authority +answer", print=log_progress
).split("\n")
]
filtered_replies = [a for a in ns_replies if len(a) >= 3 and a[3] in ("SOA", "NS")]
filtered_replies = [a for a in ns_replies if len(a) >= 5 and a[3] in ("SOA", "NS")]
if not filtered_replies:
return
return filtered_replies[0][4]