-
Couldn't load subscription status.
- Fork 127
Closed
Labels
Description
In net.py the cymru domain is set as follows
IPV4_DNS_ZONE = '{0}.origin.asn.cymru.com'
IPV6_DNS_ZONE = '{0}.origin6.asn.cymru.com'
It should be set to this:
IPV4_DNS_ZONE = '{0}.origin.asn.cymru.com.'
IPV6_DNS_ZONE = '{0}.origin6.asn.cymru.com.'
On my system there is a local search domain set which is appended after cymru.net and leads to the following error.
Traceback (most recent call last):
File "/Users/fbreedijk/repos/scripts/venv/lib/python3.11/site-packages/ipwhois/asn.py", line 146, in parse_fields_dns
ret = {'asn_registry': temp[3].strip(' \n')}
~~~~^^^
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/fbreedijk/repos/scripts/abuse2sqlite/./debug_whois.py", line 51, in <module>
print(abuse_from_whois("160.50.220.0"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fbreedijk/repos/scripts/abuse2sqlite/./debug_whois.py", line 8, in abuse_from_whois
rdap = obj.lookup_rdap(depth=2)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fbreedijk/repos/scripts/venv/lib/python3.11/site-packages/ipwhois/ipwhois.py", line 295, in lookup_rdap
asn_data = self.ipasn.lookup(
^^^^^^^^^^^^^^^^^^
File "/Users/fbreedijk/repos/scripts/venv/lib/python3.11/site-packages/ipwhois/asn.py", line 464, in lookup
asn_data_list.append(self.parse_fields_dns(
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fbreedijk/repos/scripts/venv/lib/python3.11/site-packages/ipwhois/asn.py", line 167, in parse_fields_dns
raise ASNParseError('Parsing failed for "{0}" with exception: {1}.'
ipwhois.exceptions.ASNParseError: Parsing failed for ""v=spf1 -all"" with exception: list index out of range.
I will make a PR for this change.