fix: don't fail DNS resolution on NoAnswer

This commit is contained in:
ptrcnull 2024-06-12 12:11:06 +02:00
parent 4781e088a3
commit 524a45fbc3
Signed by: ptrcnull
GPG key ID: 411F7B30801DD9CA

View file

@ -60,7 +60,7 @@ def main() -> None:
try:
res = resolver.resolve(record_name, 'TXT')
values = list(map(lambda rdata: rdata.to_text().strip('"'), res))
except dns.resolver.NXDOMAIN:
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
values = []
log.info('response from DNS: %s', values)