[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bind9 ns1 and ns2 not authorative



Andy Smith wrote:
Hi,

On Fri, Aug 22, 2008 at 06:22:21PM +0300, Juha-Matti Tapio wrote:
On Fri, Aug 22, 2008 at 03:47:42PM +0200, randall wrote:
Stephen Gran wrote:
i assumed it would not be necessary to manually add each new zone on each slave dns server, at least it does not make much sense in my reasoning, hope i'm not to wrong here ;)
You are wrong here :)
mmmmm.....at least i'm happy to find out then..

anyway to automate this process? seems like a lot of manual work here.
One option is to use PowerDNS on the slave. It has the so called
supermaster feature where the slave can be configured to add
automatically any unknown zones for which a notify is received from a
trusted IP address.

I would second this.  I was just about to respond recommending it
when I got to the end of the thread and saw this recommendation.

A couple of minor niggles I have found with PowerDNS in supermaster
mode:

- The zone has to have the slave listed as an NS

- When zones are removed they will stay in the PowerDNS database

They are not hard to work around.

Cheers,
Andy

i actually decided to try the script by marek podmaka and adjusted it a little for use with smbind, i'm sure that the part added by me (sed 'n;n;n;n;d;' |) to remove some lines is not the cleanest way to do it but it does seem to work. have this running now as a cronjob on NS2 but plan to have it called from the smbind scripts on NS1 to run it the other way around when new domains are created.


#!/bin/bash

tmpf='tmp-domains'$RANDOM
scp  123.123.123.123:/etc/smbind/smbind.conf /etc/bind/$tmpf
if [ \! -f /etc/bind/$tmpf ]; then
 exit 1
fi
cp /etc/bind/smbind.conf /etc/bind/named.conf.domains.prev
sed 's/^zone \("[^"]*"\) .*$/zone \1 { type slave; file \1; masters { 123.123.123.123; }; };/g' /etc/bind/$tmpf |
sed 'n;n;n;n;d;' |
sed 'n;n;n;d;' |
sed 'n;n;d;' |
sed 'n;d;' |
sed 's/; file \([^/]*\)\/\([^"]*\)"; /; file \1_\2"; /g' >/etc/bind/smbind.conf
rm -f /etc/bind/$tmpf
diff /etc/bind/smbind.conf /etc/bind/named.conf.domains.prev >/dev/null
if [ $? -ne 0 ]; then # files differ, reload bind
 /etc/init.d/bind9 reload
fi


Reply to: