Reverse DNS in Shell
Barry Margolin
barmar at genuity.net
Tue May 16 17:02:50 UTC 2000
In article <urshan-CFBAB8.01182416052000 at news.pacbell.net>,
Sydney Urshan <urshan at NOSPAMnethollywood.net> wrote:
>Does anyone know how to change the serial number of a reverse DNS file
>from a command line/shell script? (Or for that matter, any kind of DNS
>file?)
Assuming the line with the serial number looks something like:
123456 ; serial
and you want to increment it by 1, something like this should work:
OLDERIAL=`awk '/; serial/ {print $1}' $FILENAME`
NEWSERIAL=`expr $OLDSERIAL + 1`
ed $FILENAME <<EOF
/; serial/s/$OLDSERIAL/$NEWSERIAL/
w
q
EOF
--
Barry Margolin, barmar at genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
More information about the bind-users
mailing list