Convert a primary server named.conf to a secondary server

Otmar Lendl lendl at austria.eu.net
Wed Nov 24 15:30:54 UTC 1999


Barry Margolin  <barmar at bbnplanet.com> wrote:
>In article <kTGW3.409$75.265524 at news.abs.net>,
>Adam Furman <afurman at netscape.net> 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 { 1.2.3.4;};" } \
>     !/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 {192.92.138.35;};/;
s/master\//slave\//;

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

just fyi.

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


More information about the bind-users mailing list