Open elindsey opened 10 years ago
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.
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: