Sorry, first message was sent not for the list but to Alan only. (by the
way, why "reply" button does not send message to list by default?)

2010/10/30 Alan Clegg <acl...@isc.org>

> On 10/30/2010 1:42 AM, Sukman wrote:
> >> Looking to write a script to create the PTR records..
> >> Not much on the Web..
> >
>

I had same problem recently and i have written a script:

#!/bin/bash
NET=192.168.111
HOST=example.com
LIMIT=254
    for ((i=1;a<=LIMIT;i++))
        do
            IP=`echo $NET.$i`
            ARPA=`host $NET.$a | awk '{print $5}'`
            FIRSTOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d .
-f1`
            SECOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d .
-f2`
            THIRDOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d .
-f3`
            LASTOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d .
-f4`
            PTR=`echo host$LASTOCT.$THIRDOCT.$SECOCT.$FIRSTOCT.$HOST | grep
-v 't\.'`
            echo $LASTOCT.$THIRDOCT.$SECOCT.$FIRSTOCT.in-addr.arpa.    IN
 PTR    $PTR.  | egrep -v '^\.'
        done

My problem was to "fill the gaps" in my PTR records, because some of them
have already been created by hand before. So my script lookups for existing
PTRs and generetes the missing ones by pattern. Script is not much elegant
and clean (same my English is), but it works.
_______________________________________________
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to