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

radb.net not returning CIDR data anymore #259

Open
HQJaTu opened this issue Apr 26, 2020 · 2 comments
Open

radb.net not returning CIDR data anymore #259

HQJaTu opened this issue Apr 26, 2020 · 2 comments
Assignees

Comments

@HQJaTu
Copy link

HQJaTu commented Apr 26, 2020

This is related to #239.

I created a version which would support optional data sources for AS-information, but the change was not approved.

Example of a data query:

$ python3
Python 3.7.5 (default, Oct 17 2019, 12:21:00)
>>> from ipwhois import IPWhois, Net
>>> from ipwhois.asn import ASNOrigin
>>>
>>> ip = '216.108.228.108'
>>> asn = 26277
>>> net = Net(ip, allow_permutations=False)
>>> asn_query = ASNOrigin(net)
>>> asn_result = asn_query.lookup(asn='AS%d' % asn, asn_methods=['http'])
>>> asn_result
{'query': 'AS26277', 'nets': [], 'raw': None}

My version, querying with chosen data source of ipinfo.io. When calling python3, I force to use my own modified ipwhois-library. Also there is change in 1 line of code, the one where I choose asn_methods as my version prefers to know against which source the HTTP-query is done:

$ PYTHONPATH=../ipwhois/ python3
Python 3.7.5 (default, Oct 17 2019, 12:21:00)
>>> from ipwhois import IPWhois, Net
>>> from ipwhois.asn import ASNOrigin
>>>
>>> ip = '216.108.228.108'
>>> asn = 26277
>>> net = Net(ip, allow_permutations=False)
>>> asn_query = ASNOrigin(net)
>>> asn_result = asn_query.lookup(asn='AS%d' % asn, asn_methods=[ASNOrigin.ASN_SOURCE_HTTP_IPINFO])
>>> asn_result
{'query': 'AS26277', 'nets': [{'cidr': '216.108.224.0/24', 'description': 'Las Vegas NV Datacenter (PREMIANET)'}, {'cidr': '216.108.225.0/24', 'description': 'Las Vegas NV Datacenter (PREMIANET)'}, 

I still urge this multi-source option to be considered. When this worked last time against radb.net, it returned one (1) net for the above query. In above example, I'm omitting most of the reqonse, but reality is, for that query there are 64 CIDRs in response. Not 0. Not 1. Obviously, you can make 5 ASN-queries / day / IP-address on non-paid ipinfo.io API. This known limitation can be lifted by creating a paid account.

Please, reconsider my PR.

@secynic
Copy link
Owner

secynic commented Sep 2, 2020

Please try the dev branch. Here is what I am seeing returned from RADB:
{'nets': [{'cidr': '72.18.192.0/20', 'description': 'Integra Telecom Route Object', 'maintainer': 'MAINT-AS7385', 'source': 'RADB', 'updated': 'edward.arneson@integratelecom.com 20080725'}, {'cidr': '216.108.224.0/20', 'description': 'Integra Telecom Route Object', 'maintainer': 'MAINT-AS7385', 'source': 'RADB', 'updated': 'edward.arneson@integratelecom.com 20080725'}, {'cidr': '64.235.32.0/19', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20040313'}, {'cidr': '64.235.32.0/20', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20041006'}, {'cidr': '64.235.48.0/21', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20041006'}, {'cidr': '64.235.56.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20041006'}, {'cidr': '64.235.61.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20041006'}, {'cidr': '64.235.62.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20041006'}, {'cidr': '64.235.63.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20041006'}, {'cidr': '64.235.58.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20041114'}, {'cidr': '72.18.195.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20050306'}, {'cidr': '72.18.200.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20050424'}, {'cidr': '72.18.201.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20050619'}, {'cidr': '72.18.206.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20050801'}, {'cidr': '72.18.207.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20050801'}, {'cidr': '72.18.204.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20050929'}, {'cidr': '72.18.205.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20050929'}, {'cidr': '72.18.202.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20051017'}, {'cidr': '72.18.203.0/24', 'description': 'Proxy-registered route object', 'maintainer': 'MAINT-AS3491', 'source': 'RADB', 'updated': 'sajwani@pccwbtn.com 20051017'}, {'cidr': '64.235.32.0/19', 'description': 'REACH (Customer Route)', 'maintainer': 'MAINT-REACH-NOC', 'source': 'REACH\nchanged: irr@team.telstra.com 20170213', 'updated': 'irr@team.telstra.com 20170213</code></pre>'}, {'cidr': '72.18.192.0/20', 'description': 'REACH (Customer Route)', 'maintainer': 'MAINT-REACH-NOC', 'source': 'REACH\nchanged: irr@team.telstra.com 20170213', 'updated': 'irr@team.telstra.com 20170213</code></pre>'}, {'cidr': '216.108.224.0/20', 'description': 'REACH (Customer Route)', 'maintainer': 'MAINT-REACH-NOC', 'source': 'REACH\nchanged: irr@team.telstra.com 20170213', 'updated': 'irr@team.telstra.com 20170213</code></pre>'}], 'query': 'AS26277', 'raw': None}

@secynic secynic self-assigned this Sep 2, 2020
@RoboJaTu
Copy link

RoboJaTu commented Sep 4, 2020

Dev-branch does work and returns valid data. The only minor thing is, that RADb returns only top-level network information. IPinfo.io will return all the /24 networks summing up to /19. What I typically do, is combine the networks to get what RADb will return directly. So, this is a non-issue to me.

Ultimately, I can use this version in my application. Thank you!

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

No branches or pull requests

3 participants