you need a 2nd server and then :
you create a folder below your admin domain i.e. ( admin.yourdomain.com/tools/dns-export.php )
then you create a script which exports a named.conf.local so your slave dns server knows about the domains it needs to get....
Code:
<?
$link = mysql_connect("localhost", "pdns_sql", "your db pw")
or die("No connection possible: " . mysql_error());
mysql_select_db("ispcp") or die("Database selection impossible!");
/* execute SQL query for domains */
$query = "SELECT domain_name as name FROM domain union select alias_name as name from domain_aliasses ";
$query = "union select (select concat(a.subdomain_name,'.',b.domain_name) from subdomain a left join domain as b on a.domain_id=b.domain_id) as name";$query = "union select (select concat(a.subdomain_alias_name,'.',b.alias_name) from subdomain_alias a left join domain_aliasses b on a.alias_id=b.alias_id) as name ";
$result = mysql_query($query) or die("Queery failed: " . mysql_error());
$zonefile = "# autogenerated Zonefile do not edit !\r\n";
$zonefile .= "include \"/etc/bind/zones.rfc1918\";\r\n";
$master = "<IP of your dns master>";
$zonefiledir = "/var/cache/bind";
while ($daten = mysql_fetch_array($result)) {
$zone = $daten['name'];
if ( $zone !="NULL" ) {
$zonefile .= "zone \"$zone\" { \n
type slave; \n
file \"$zonefiledir/$zone.db\"; \n
masters { $master; }; \n
allow-notify { $master; }; \n
}; \n
";
}
}
echo $zonefile;
?>
then you place a script on the slave dns server like that :
Code:
#!/bin/sh
#
# update bind zones every 20 minutes
#
PATH=/usr/bin:/bin:/usr/sbin
LOG=/var/log/dns-update.log
date > $LOG
wget -O /etc/bind/named.conf.local http://admin.yourdomain.com/tools/dns_export.php >> $LOG 2>&1
if [ $? = 0 -a -s /etc/bind/named.conf.local ]; then
rndc reload >> $LOG 2>&1
else
echo "Uh, oh...." >> $LOG
fi
Then check that the slave server gets a valid named.conf.local file.
If yes, take care to make a section like
Code:
<location /tools/dns_export.php>
order deny, allow
deny from all
allow from <ip of your slave server>
</location>
so that not everybody can read your domain infos ...
That should do the trick basically ..