Skip to content

Commit

Permalink
Cymru fix for local domain ASN search #324
Browse files Browse the repository at this point in the history
  • Loading branch information
secynic committed Oct 13, 2024
1 parent 5634717 commit b5aafb2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ipwhois/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit b5aafb2

Please sign in to comment.