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

Parsing responses for IP queries #292

Open
elindsey opened this issue Dec 25, 2013 · 1 comment
Open

Parsing responses for IP queries #292

elindsey opened this issue Dec 25, 2013 · 1 comment

Comments

@elindsey
Copy link

Today when I query for an IP I seem to just get the hostname and a giant body blob back. It'd be great if that could be broken down into common fields, similar to the domain lookups.

IP whois data is a bit of a mess. This is the only lib I've seen that does a decent job of parsing out a common subset (though the API is atrocious); it might be a useful reference - http://search.cpan.org/~romm/Net-Whois-IANA-0.41/lib/Net/Whois/IANA.pm

A few gotchas that could be relevant:

  • some have OrgName, some have descr; lots of people don't fill descr out the way they're supposed to, so you end up with awful entries like "Shared Webhosting". Not much you can do about crummy data though.
  • some have CIDR instead of netrange, so you'll likely need to expand that. Expect some strangely formatted CIDRs though (like 192.12/16, usually from LACNIC)
  • some of the RIRs throttle; not sure if you're handling that in the lib today or punting it up to an application concern
  • depending on what servers you hit, you can get some annoyingly useless responses. For example, a given IP that's been suballocated might get the final allocation you're interested in, or you might just see that it's been assigned to eg. APNIC
@mgold
Copy link

mgold commented Apr 23, 2014

I too am interested in the CIDR for an IP query. It shouldn't be too hard to add :cidr = nil or something to the parser parent classes, and then override that when information is available. An IPAddr object seems like a useful non-nil value. Its constructor can handle a CIDR string (as long as all 4 octets are there) but not a netrange (workaround). Sometimes that's all that's available; lookup 1.164.0.0.

There's certainly a lot of other information that can be extracted but I'd rather have CIDR working in many cases than never get the general solution online.

@weppos weppos changed the title Feature Request - Parsing responses for IP queries Parsing responses for IP queries Nov 11, 2014
@weppos weppos added the parser label Nov 6, 2016
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

3 participants