Strange one-word DNS name
Kevin Darcy
kcd at daimlerchrysler.com
Mon Feb 19 23:29:11 UTC 2001
Angus Mackay wrote:
> It would seem that Obi Wan (obiwan at mahood.com) said:
> > Thanks. Do you know how to convert between the two?
>
> the hard way:
> $ perl -e 'foreach $arg (@ARGV) { $a1 = ($arg & 0xff000000)>>24; $a2 = ($arg & 0xff0000)>>16; $a3 = ($arg & 0xff00)>>8; $a4 = ($arg & 0xff); print "$arg --> $a1.$a2.$a3.$a4\n"; }' 3506561497 1047530039
> 3506561497 --> 209.1.225.217
> 1047530039 --> 62.112.10.55
It doesn't have to be *quite* that ugly:
perl -e 'map { printf("%s --> %s\n", $_, join(".", unpack("C4", pack("I", $_)))) } @ARGV' 3506561497 1047530039
- Kevin
More information about the bind-users
mailing list