fix: don't fail when upstream DNS returns no AAAA records
workaround for silly recursors
This commit is contained in:
parent
2ca4710a91
commit
62e01cbcbf
1 changed files with 7 additions and 1 deletions
|
@ -82,7 +82,13 @@ def resolve4(addr: str) -> list[str]:
|
||||||
return list(map(str, res))
|
return list(map(str, res))
|
||||||
|
|
||||||
def resolve6(addr: str) -> list[str]:
|
def resolve6(addr: str) -> list[str]:
|
||||||
|
try:
|
||||||
res = dns.resolver.resolve(addr, 'AAAA')
|
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))
|
return list(map(str, res))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue