From 5a0c12518363796943243511ac15df3a28556ce7 Mon Sep 17 00:00:00 2001 From: Michael Hinz Date: Thu, 12 Feb 2026 16:26:18 +0100 Subject: [PATCH] fix: cut off irrelevant seconds-to-TTL in DNS answer --- main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 9392d61..343cc6c 100644 --- a/main.py +++ b/main.py @@ -32,10 +32,12 @@ def main(): answer = r.resolve(qname=zone, rdtype='DNSKEY', tcp=False, search=ns) if not expected: expected = answer.rrset.to_text() - # print(f"set {expected=}") + expected = expected[expected.find('IN ')] else: - if answer.rrset.to_text() != expected: - logging.debug(f"{answer.rrset.to_text()=} differs from {expected=}") + answer_text = answer.rrset.to_text() + answer_text = answer_text[answer_text.find('IN ')] + if answer_text != expected: + logging.debug(f"'{answer_text}' differs from '{expected}', bumping SOA record for {zone}") # I'm very confident this is more complicated than it needs to be... db.query(f"""SELECT id,content FROM records WHERE type='SOA' AND name='{zone}'""") result = db.store_result()