fix: cut off irrelevant seconds-to-TTL in DNS answer
This commit is contained in:
parent
9b0768da79
commit
5a0c125183
1 changed files with 5 additions and 3 deletions
8
main.py
8
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue