pint> use Net::IP
pint> $foo = new Net::IP '2001:db8::42'
3
pint> $foo->reverse_ip()
2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d. 0.1.0.0.2.ip6.arpa.
pint>

Or you could just dash off the simple perl expression to do the job:

my $ptr = do {
    my($head,$tail) =
      map { join '', map { sprintf '%04s',$_; } split /:/,$_; }
      split /::/, $addr  . '::', 3;
    my $hex32 = '0' x 32;
    substr( $hex32, 0, length($head) ) = $head;
    substr( $hex32, 32, -length($tail) ) =  $tail;
    join '.', ( reverse split //, $hex32 ), 'ip6.arpa';
    };


John
_______________________________________________
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to