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?) <br><br><div class="gmail_quote">2010/10/30 Alan Clegg <span dir="ltr"><<a href="mailto:aclegg@isc.org">aclegg@isc.org</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">On 10/30/2010 1:42 AM, Sukman wrote:<br>
>> Looking to write a script to create the PTR records..<br>
>> Not much on the Web..<br>
><br></div></div></blockquote><div> </div><div><div>I had same problem recently and i have written a script:<br><br>#!/bin/bash<br>NET=192.168.111<br>HOST=<a href="http://example.com/" target="_blank">example.com</a><br>
LIMIT=254<br>
for ((i=1;a<=LIMIT;i++))<br> do <br> IP=`echo $NET.$i`<br> ARPA=`host $NET.$a | awk '{print $5}'`<br> FIRSTOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d . -f1`<br>
SECOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d . -f2`<br> THIRDOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d . -f3`<br> LASTOCT=`echo $IP $ARPA | grep NX | awk '{print $1}' | cut -d . -f4`<br>
PTR=`echo host$LASTOCT.$THIRDOCT.$SECOCT.$FIRSTOCT.$HOST | grep -v 't\.'`<br> echo $LASTOCT.$THIRDOCT.$SECOCT.$FIRSTOCT.in-addr.arpa. IN PTR $PTR. | egrep -v '^\.'<br> done<br>
</div><br>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. <br></div></div><br>