From 524a45fbc30753e379cc5ecf2992b37bf3361c55 Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Wed, 12 Jun 2024 12:11:06 +0200 Subject: [PATCH] fix: don't fail DNS resolution on NoAnswer --- nyacme/hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nyacme/hook.py b/nyacme/hook.py index e2fb34c..a0c1c93 100644 --- a/nyacme/hook.py +++ b/nyacme/hook.py @@ -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)