> Am 22.06.2021 um 17:14 schrieb Axel Rau <
Axel...@chaos1.de>:
>
> Even replacing Exception by BaseException() does not help.
It seems that resolver.zone_for_name sometimes failes to find a IPv6 reverse zone, which causes the timeout:
- - -
%createZoneFromName/zone_for_name name=2001:4bd8:0:104:20a:e4ff:fe80:3138, fqdn=8.3.1.3.0.8.e.f.f.f.4.e.a.0.2.0.4.0.1.0.0.0.0.0.8.d.b.4.1.0.0.2.ip6.arpa.,
because Timeout [The DNS operation timed out after 5.002438068389893 seconds]
- - -
- - -
def createZoneFromName(self, dtype, name):
if dtype in ('NS', 'MX', 'CNAME', 'DNAME', 'PTR', 'SRV'): # a domain fqdn
if name[-1] == '.': # already absolute?
fqdn = name
else: # no, relative - make absolute
fqdn = name + '.' + self.zone_name
if len(domainZones.keys()) > zad.common.MAX_ZONES:
return
elif dtype == 'A': # address
if len(ip4Zones.keys()) > zad.common.MAX_ZONES:
return
fqdn = dns.reversename.from_address(name)
elif dtype == 'AAAA': # address
if len(ip6Zones.keys()) > zad.common.MAX_ZONES:
return
fqdn = dns.reversename.from_address(name)
else: # ignore others
return
try:
zoneName = str(dns.resolver.zone_for_name(fqdn))
print('createZoneFromName: name={}, fqdn={} OK: zone={}'.format(name, fqdn, zoneName))
except dns.name.EmptyLabel:
print('Empty label: name={}, dtype={}'.format(name, dtype))
except BaseException:
print('%createZoneFromName/zone_for_name name={}, fqdn={},\n because {} [{}]'.
format(name, fqdn,
sys.exc_info()[0].__name__,
str(sys.exc_info()[1])))
return
- - -
Is the cause a missing delegation or a bug?
Can you give me a tip to filter such IPs and not try to find there zone?
Thanks, Axel