How do I know which IP ranges are being allocated to the 5 Regional Internet Registries such as ARIN and RIPE, and thus which whois to query.
If I make it static, how often would I have to update the list? Or are all IPv4 ranges gone now..
The previous answers seems not to be fully correct. IANA lists 62/8 for RIPE NCC but e.g. for 62.68.234.234 whois.ripe.net will respond with:
IPv4 address block not managed by the RIPE NCC
I guess the reliable approach would be to load the assignment lists and check against those (like suggested here).
This is for IPv4, and this for IPv6.