diff --git a/nyacme/hook.py b/nyacme/hook.py index cdc9792..e88a71e 100644 --- a/nyacme/hook.py +++ b/nyacme/hook.py @@ -82,7 +82,13 @@ def resolve4(addr: str) -> list[str]: return list(map(str, res)) def resolve6(addr: str) -> list[str]: - res = dns.resolver.resolve(addr, 'AAAA') + try: + res = dns.resolver.resolve(addr, 'AAAA') + except dns.resolver.NoAnswer: + # workaround for silly recursors that return NOERROR + # empty response when they don't support IPv6 + log.warning('no IPv6 nameservers returned') + res = [] return list(map(str, res))