IP::Authority(3)

πŸ“¦ version 2.28, in opensuse-leap 16.0

πŸ’– IP::Authority(3) πŸ’–

hey bestie, welcome to IP::Authority β€” the perl module that does fast lookup of authority by IP address. yes she's a whole elder (perl v5.42.0 vibes, dated 2015-04-14) but she still ate and she's still iconic. let's get into it 🫢


✨ NAME ✨

IP::Authority β€” fast lookup of authority by IP address. that's the whole brand, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the vibe in code form, copy it exactly pls:

use IP::Authority;
my $reg = IP::Authority->new();
print $reg->inet_atoauth('212.67.197.128')   ."\n";
print $reg->inet_atoauth('www.slashdot.org') ."\n";

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, history lesson bestie πŸ“š β€” back in the day, the former InterNIC managed (under the auspices of IANA) the allocation of IP numbers to ISPs and other organizations. then things changed somewhat when the Regional Internet Registry system was started, with the creation of three (and later, four) Regional Internet Registries (RIRs) around the world, each one managing the allocation of IP addresses to organizations within differing physical areas (see also RFC2050).

which means... there is no central whois database for IP numbers. it's giving decentralized, honestly πŸ’…

so this module lets you look up the RIR who has authority for a particular IP address. and then β€” plot twist β€” after finding out the authority for an IP address, it's possible to use the authority's whois server to look up the netblock owner. slay πŸ”₯


🌸 CONSTRUCTOR 🌸

the constructor takes no arguments. none. zero. she's low maintenance.

use IP::Authority;
my $reg = IP::Authority->new();

⭐ OBJECT METHODS ⭐

all object methods are designed to be used in an object-oriented fashion, bestie:

$result = $object->foo_method($bar,$baz);
okay important: using the module in a procedural fashion (without the arrow syntax) won't work. like, it literally will not work. don't do it πŸ™ˆ
  • $auth = $reg->inet_atoauth(HOSTNAME) β€” takes a string giving the name of a host, and translates that to a two-letter string representing the regional Internet registry that has authority of that IP address:
AR = ARIN (North America)
RI = RIPE (Europe)
LA = LACNIC (Latin America)
AP = APNIC (Asia-Pacific)
AF = AFRINIC (Africa and Indian Ocean)
IA = IANA (see RFC3330)

takes arguments of both the 'rtfm.mit.edu' type and '18.181.0.24'. if the host name cannot be resolved, returns undef. if the resolved IP address is not contained within the database, returns undef. for multi-homed hosts (hosts with more than one address), the first address found is returned.

  • $auth = $reg->inet_ntoauth(IP_ADDRESS) β€” takes a string (an opaque string as returned by Socket::inet_aton()) and translates it into a two-letter string representing the regional Internet registry that has authority of that IP address:
AR = ARIN (North America)
RI = RIPE (Europe)
LA = LACNIC (Latin America)
AP = APNIC (Asia-Pacific)
AF = AFRINIC (Africa and Indian Ocean)
IA = IANA (see RFC3330)

if the IP address is not contained within the database, returns undef.

  • $t = $reg->db_time() β€” returns the creation date of the database, measured as number of seconds since the Unix epoch (00:00:00 GMT, January 1, 1970). suitable for feeding to "gmtime" and "localtime". cute for timestamps fr fr πŸ•

πŸ’€ BUGS/LIMITATIONS πŸ’€

only works with IPv4 addresses and ASCII hostnames. that's it. that's the limitation. no IPv6, no fancy unicode hostnames, she said what she said 😭


🌈 SEE ALSO 🌈


copyright (C) 2002-2005 Nigel Wetters Gourlay. all rights reserved.

NO WARRANTY. this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. (perl's terms, not mine, don't @ me πŸ’…)

some parts of this software distribution are derived from the APNIC, LACNIC, ARIN, AFRINIC and RIPE databases (copyright details below). and listen β€” "I am not a lawyer, so please direct questions about the RIR's licenses to them, not me." iconic disclaimer honestly πŸ™ˆ

🧚 APNIC conditions of use 🧚

the files are freely available for download and use on the condition that APNIC will not be held responsible for any loss or damage arising from the application of the information contained in these reports.

APNIC endeavours to the best of its ability to ensure the accuracy of these reports; however, APNIC makes no guarantee in this regard.

in particular, it should be noted that these reports seek to indicate the country where resources were first allocated or assigned. it is not intended that these reports be considered as an authoritative statement of the location in which any specific resource may currently be in use. (read that twice bestie, it matters 🫢)

copyright (c) American Registry for Internet Numbers. all rights reserved.

the ARIN WHOIS data is for Internet operational or technical research purposes pertaining to Internet operations only. it may not be used for advertising, direct marketing, marketing research, or similar purposes. use of the ARIN WHOIS data for these activities is explicitly forbidden. ARIN requests to be notified of any such activities or suspicions thereof. so like... behave. 🚨

the information in the RIPE Database is available to the public for agreed Internet operation purposes, but is under copyright. the copyright statement is:

"Except for agreed Internet operational purposes, no part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without prior permission of the RIPE NCC on behalf of the copyright holders. Any use of this material to target advertising or similar activities is explicitly forbidden and may be prosecuted. The RIPE NCC requests to be notified of any such activities or suspicions thereof."

word. ✨

copyright (c) Latin American and Caribbean IP address Regional Registry. all rights reserved.

seems to be the RIPE copyright. "I'm sure they'll correct this in due course." β€” the author, being so real 😭


and that's the whole page bestie! πŸ’– this was IP::Authority(3), delivered to you by perl v5.42.0, dated 2015-04-14, from the User Contributed Perl Documentation corner of the universe. go look up some IPs, stay IPv4-only, and remember: no central whois database, only vibes πŸŒΈπŸ¦‹πŸ’…

πŸ“¦ where this page comes from