FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian ISP

 
 
LinkBack Thread Tools
 
Old 08-22-2008, 02:22 PM
Gavin Westwood
 
Default bind9 ns1 and ns2 not authoritative

On 22/08/08 15:04, randall wrote:

the
number of zones will be several hundreds, and the reason i planned to
use smbind is because i need them added by somebody who is not familiar
with hand editing files.




any script recommendations?




I also use smbind and on the primary DNS server, you should be able to
script an INSERT into the appropriate SQL tables with a standard
zonefile configuration, or if you already have them in existing Bind
zone files, there is an import script that I modified - please mail me
offlist if you want me to email it to you.* I was planning to make a
fork off of smbind as I've altered my copy slightly and the project had
seemed to be dead when I downloaded it earlier this year, but I've not
had time.* I also see there's been some activity on the bug tracker
since then...



I'm not sure if smbind can be used for secondary domains as there is no
option for this, but I'm sure it could be altered to do so.



Gavin



--



Gavin Westwood

Solutium



http://www.solutium.net - Going the extra mile to provide a fast,
helpful, reliable Web Hosting service.
 
Old 08-22-2008, 06:24 PM
randall
 
Default bind9 ns1 and ns2 not authoritative

Gavin Westwood wrote:

On 22/08/08 15:04, randall wrote:
the number of zones will be several hundreds, and the reason i
planned to use smbind is because i need them added by somebody who is
not familiar with hand editing files.


any script recommendations?


I also use smbind and on the primary DNS server, you should be able to
script an INSERT into the appropriate SQL tables with a standard
zonefile configuration, or if you already have them in existing Bind
zone files, there is an import script that I modified - please mail me
offlist if you want me to email it to you. I was planning to make a
fork off of smbind as I've altered my copy slightly and the project
had seemed to be dead when I downloaded it earlier this year, but I've
not had time. I also see there's been some activity on the bug
tracker since then...


I'm not sure if smbind can be used for secondary domains as there is
no option for this, but I'm sure it could be altered to do so.


Gavin

--

Gavin Westwood
Solutium

http://www.solutium.net - Going the extra mile to provide a fast,
helpful, reliable Web Hosting service.


after my NoOb discovery that all slave entries have to be added manually
on ns2 i found very little ready made scripts available on google for
automation and those i found where pretty messy or not usable on debian,
or i'm looking in the wrong places.




some hypothetical questions here i'd like to ask you since i guess you
have more insight in this.


smbind uses mysql to store the zone data and then produce the zone text
files in /etc/smbind/zones and /etc/smbind/smbind.conf to feed it to
bind. right?
wouldn't it make sense to use the existing option to have php produce
the slave entries in the same fashion as the master entries in
/etc/smbind/smbind.conf ?


one could use mysql replication but then you would a mysql instance and
trigger a php script and on the slave as well or have bind query mysql
direcly.
to make it simple i guess, one could create /etc/smbind/masterzones.conf
and /etc/smbind/slavezones.conf and call a script to scp or rsync to
transfer the slavezones.conf


this would only require a small modification to commit.php i suppose and
a lot cleaner then the cron jobs i've seen on google so far.


i never did much with php but this should be doable i think in some
sleepless nights, so please stop me if i'm re-inventing the wheel here



if (isset($rebuild)) {
$confres = $dbconnect->query("SELECT name FROM zones ORDER BY name");
is_error($confres);

$cout = "";
while($conf = $confres->fetchrow()) {
$cout .= "zone "" . $conf[0] . "" {
type master;
file "" . preg_replace('///','-',$conf[0]) . "";
};

";
}


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 08-23-2008, 11:44 AM
Marek Podmaka
 
Default bind9 ns1 and ns2 not authoritative

Hello,

Friday, August 22, 2008, 20:24:27, randall wrote:

> after my NoOb discovery that all slave entries have to be added manually
> on ns2 i found very little ready made scripts available on google for
> automation and those i found where pretty messy or not usable on debian,
> or i'm looking in the wrong places.

I don't know smbind, but when you write that it just produces bind
config files from db, my script should be usable. I run it
periodically from cron on slave (and manually from master when adding
zone: ssh slave transfer-bind-zones.sh). You must have zones config in
separate file (for example named.conf.domains). It transfers it and
modifies the records from typu master to type slave.

The entries should be like this:
zone "abc.com" IN {type master; file "abc.com"; };
and script changes that into:
zone "abc.com" { type slave; file "abc.com"; masters { 1.2.3.4; }; };

(the second "sed" in script is probably only for reverse domains which have
different filename structure, but don't remember it well.)

================================================== =======
kenny:~:# cat /usr/local/sbin/transfer-bind-zones.sh
#!/bin/bash

tmpf='tmp-domains'$RANDOM
scp master_server:/etc/bind/named.conf.domains /etc/bind/$tmpf
if [ ! -f /etc/bind/$tmpf ]; then
echo "was not able to get new domains list" | mail -s "bind reload FAILED" root
exit 1
fi
cp /etc/bind/named.conf.domains /etc/bind/named.conf.domains.prev
sed 's/^zone ("[^"]*") .*$/zone 1 { type slave; file 1; masters { 1.2.3.4; }; };/g' /etc/bind/$tmpf |
sed 's/; file ([^/]*)/([^"]*)"; /; file 1_2"; /g' >/etc/bind/named.conf.domains
rm -f /etc/bind/$tmpf
diff /etc/bind/named.conf.domains /etc/bind/named.conf.domains.prev >/dev/null
if [ $? -ne 0 ]; then # files differ, reload bind
/etc/init.d/bind9 reload
echo "secondary zone changed, bind reloaded" | mail -s "bind reloaded" root
fi
================================================== =======


--
bYE, Marki


--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 03:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org