From b5aafb207611d3c8701ae7206c4696a2bf096f7c Mon Sep 17 00:00:00 2001 From: secynic Date: Sat, 12 Oct 2024 23:14:37 -0500 Subject: [PATCH] Cymru fix for local domain ASN search #324 --- ipwhois/net.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ipwhois/net.py b/ipwhois/net.py index 232a9cd..091f802 100644 --- a/ipwhois/net.py +++ b/ipwhois/net.py @@ -73,9 +73,9 @@ CYMRU_WHOIS = 'whois.cymru.com' -IPV4_DNS_ZONE = '{0}.origin.asn.cymru.com' +IPV4_DNS_ZONE = '{0}.origin.asn.cymru.com.' -IPV6_DNS_ZONE = '{0}.origin6.asn.cymru.com' +IPV6_DNS_ZONE = '{0}.origin6.asn.cymru.com.' BLACKLIST = [ 'root.rwhois.net' @@ -221,6 +221,8 @@ def get_asn_dns(self): log.debug('ASN query for {0}'.format(self.dns_zone)) data = self.dns_resolver.resolve(self.dns_zone, 'TXT') + log.debug('ASN query results using {0}: {1}'.format( + self.dns_zone, list(data))) return list(data) except (dns.resolver.NXDOMAIN, dns.resolver.NoNameservers, @@ -257,7 +259,7 @@ def get_asn_verbose_dns(self, asn=None): asn = 'AS{0}'.format(asn) - zone = '{0}.asn.cymru.com'.format(asn) + zone = '{0}.asn.cymru.com.'.format(asn) try: