Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

script? for converting A to PTR

0 views
Skip to first unread message

Drew Weaver

unread,
Nov 30, 2001, 10:24:21 AM11/30/01
to

Does anyone have a script that will take a file full of FORWARDS
(ie. A records) and convert them into PTR records? If so let me know please.

Kevin Darcy

unread,
Nov 30, 2001, 8:28:45 PM11/30/01
to

Drew Weaver wrote:

> Does anyone have a script that will take a file full of FORWARDS
> (ie. A records) and convert them into PTR records? If so let me know please.

Quick and dirty:

#!/usr/bin/perl

while (<>) {
@line = split(/\s/);
$foo{$line[-1]} = $line[0];
}
foreach $i (keys(%foo)) {
printf("%s.in-addr.arpa. ptr %s.\n",
join('.', reverse(split(/\./, $i))), $foo{$i});
}


- Kevin

0 new messages