Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot do bulk_whois on '177.104.124.235' #290

Open
DolleDries opened this issue Sep 28, 2020 · 8 comments
Open

Cannot do bulk_whois on '177.104.124.235' #290

DolleDries opened this issue Sep 28, 2020 · 8 comments
Assignees
Milestone

Comments

@DolleDries
Copy link

Code:

from ipwhois import IPWhois
from ipwhois.experimental import get_bulk_asn_whois
from ipwhois.experimental import bulk_lookup_rdap
from pprint import pprint

#ipno = '23.129.64.151'
ipno = '177.104.124.235'
IPlist = [ipno]
print ipno
obj = IPWhois(ipno)

RDAP = obj.lookup_rdap(depth=1)
print "Rdap"
pprint(RDAP)

WHOIS = obj.lookup_whois()
print "WhoIs"
pprint(WHOIS)

"""
Weird, Bulk-mode does't work on '177.104.124.235'. Why? Are there more
IPno's it doen't work on?
"""

BULK = get_bulk_asn_whois(addresses=IPlist, retry_count=5)

print "Bulk"

pprint(BULK)

RDAP = bulk_lookup_rdap(addresses=IPlist)

print "RDAP"

pprint(RDAP)

print "%s ([%s], %s,%s)" % (ipno, WHOIS['asn_description'], WHOIS['asn_country_code'], WHOIS['asn_cidr'] )

@secynic
Copy link
Owner

secynic commented Sep 28, 2020

bulk_lookup_rdap returns a named tuple.

Try this:
results, stats = bulk_lookup_rdap(['177.104.124.235'])

@DolleDries
Copy link
Author

DolleDries commented Sep 28, 2020 via email

@secynic
Copy link
Owner

secynic commented Sep 28, 2020

Can you include the output from logging? Put this above your code:

import logging
LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] '
   '[%(funcName)s()] %(message)s')
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)

@DolleDries
Copy link
Author

DolleDries commented Sep 29, 2020 via email

@DolleDries
Copy link
Author

DolleDries commented Sep 29, 2020 via email

@DolleDries
Copy link
Author

DolleDries commented Sep 29, 2020 via email

@secynic secynic self-assigned this Sep 29, 2020
@secynic secynic added this to the 1.3.0 milestone Sep 29, 2020
@secynic
Copy link
Owner

secynic commented Sep 29, 2020

I'm going to use this issue to provide the original error message on line 110 in get_bulk_asn_whois.

Is outbound port 43/TCP enabled for you? Can you hit whois.cymru.com:43?

@DolleDries
Copy link
Author

DolleDries commented Sep 30, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants