Skip to content

Parsing responses for IP queries #292

@elindsey

Description

@elindsey

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions