Convert a primary server named.conf to a secondary server

Otmar Lendl lendl at
Wed Nov 24 15:30:54 UTC 1999

Barry Margolin  <barmar at> wrote:
>In article <kTGW3.409$75.265524 at>,
>Adam Furman <afurman at> wrote:
>>I would like to know if anyone knows of a script that convert a primary name
>>server config file over to a secondary name server config file.  This way we
>>only work on the primary and run this script with cron so the secondary will
>>get the info.  Any help would be great.
>awk '/type master;/ { print "type slave; masters {;};" } \
>     !/type master;/ { print $0 };' master.named.conf > slave.named.conf

I use:

#!/usr/local/bin/perl -p
# convert a master config file to a slave config with ns1 as master.
s/^([#\/\s]*)type\s+master\s*;/$1type slave;\n$1masters {;};/;

(we keep the files in ./slave or ./master)

just fyi.

/ Otmar Lendl (O.Lendl at | Phone: +43 1 89933-0  (-533 fax) \
\          EUnet tech staff            |  Diefenbachgasse 35 A-1150 Wien  /

More information about the bind-users mailing list