Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Whois-Raw CPAN distribution.

Report information
The Basics
Id: 91903
Status: rejected
Priority: 0/
Queue: Net-Whois-Raw

People
Owner: Nobody in particular
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.48
Fixed in: (no value)



Subject: Not working with SixxS IPv6 addresses
Calling Net::Whois::Raw::whois on, e.g. 2001:4830:11a2:941:7593:3098:e849:669e Returns the whois data for CIDR: 2001:4830::/32 But the whois command line (jwhois v 4.0) returns the more useful data for inet6num: 2001:4830:11a2::/48 It seems that whois() isn't consulting the SixXS whois server (http://www.sixxs.net), which holds the allocation. Data.pm sends all ip addresses to whois.arin.net, but there's no referral from the /32. jwhois seems to special-case sixxs. sixxs.net is a large provider of IPv6 tunnels, so it would be helpful if this worked. Here is the entry from /etc/jwhois.conf: # # IPv6 blocks by carriers used for SixXS; # see e.g. http://www.sixxs.net/pops/ # "2001:0610::/32" = "whois.sixxs.net"; "2001:06A0::/32" = "whois.sixxs.net"; "2001:06A8::/32" = "whois.sixxs.net"; "2001:06F8::/32" = "whois.sixxs.net"; "2001:0770::/32" = "whois.sixxs.net"; "2001:07B8::/32" = "whois.sixxs.net"; "2001:0808::/32" = "whois.sixxs.net"; "2001:0838::/32" = "whois.sixxs.net"; "2001:0960::/32" = "whois.sixxs.net"; "2001:0A60::/32" = "whois.sixxs.net"; "2001:0AD0::/32" = "whois.sixxs.net"; "2001:0B18::/32" = "whois.sixxs.net"; "2001:1418::/32" = "whois.sixxs.net"; "2001:14B8::/32" = "whois.sixxs.net"; "2001:15C0::/32" = "whois.sixxs.net"; "2001:16D8::/32" = "whois.sixxs.net"; "2001:1938::/32" = "whois.sixxs.net"; "2001:4830::/32" = "whois.sixxs.net"; "2001:4978::/32" = "whois.sixxs.net"; "2001:41E0::/32" = "whois.sixxs.net"; "2001:4428::/32" = "whois.sixxs.net"; "2A01:0198::/32" = "whois.sixxs.net"; "2A01:0348::/32" = "whois.sixxs.net";
From: tlhackque [...] yahoo.com
On reflection, parsing /etc/jwhois.conf would be a good way to find the whois servers. The advantage over the hard-coded tables is that the OS distribution will update the conf file. (No harm in falling back to the hard-coded tables for platforms that don't have the conf file.) I use this code for whois (IP addr). %v4 and %v6 are extracts from the file - I haven't implemented parsing it for my application since the extracts are 'good enough' for now. The keys are "address/mask", the values are "whois.foo.net". sub whois_server { my $ip = Net::IP->new( shift ) or return undef; if( $ip->version == 4 ) { my @v4 = sort { $b->[0]->prefixlen <=> $b->[0]->prefixlen } map { my $i = Net::IP->new($_) or die "Bad IP data: $_ (" . Net::IP::Errno() . ') ' . Net::IP::Error(); return [ $i, $_ ]; } keys %v4; foreach my $r (@v4) { my $o = $r->[0]->overlaps( $ip ); if( $o == $IP_B_IN_A_OVERLAP || $o == $IP_IDENTICAL ) { return $v4{$r->[1]}; } } } else { my @v6 = sort { $b->[0]->prefixlen <=> $b->[0]->prefixlen } map { my $i = Net::IP->new($_) or die "Bad IP data: $_ (" . Net::IP::Errno() . ') ' . Net::IP::Error(); return [ $i, $_ ]; } keys %v6; foreach my $r (@v6) { my $o = $r->[0]->overlaps( $ip ); if( $o == $IP_B_IN_A_OVERLAP || $o == $IP_IDENTICAL ) { return $v6{$r->[1]}; } } } return undef; # use Net::Whois::Raw default server }
Hello, I didn't find these ip6 blocks in cidr6-blocks section of jwhois 4.0 default config. I'm afraid sixxs whois server should not be regarded as "official". So I do not think it's good idea to hardcode this server in Net::Whois::Raw.
See answer of Alexander Nalobin.