Thread: DNS Replication
View Single Post
  #1  
Old 8th January 2010, 22:40
Uvigii Uvigii is offline
Junior Member
 
Join Date: Aug 2006
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default DNS Replication

2 (or more) ISPC3. Updates on 1st are propagated to all MyDNS. Need testing and feedback.
I've change the following (on the slave server):
/etc/mydns.conf
Code:
soa-where = server_id = X
rr-where =  server_id = X
Code:
soa-where = server_id = 1
rr-where =  server_id = 1
/usr/local/ispconfig/server/server.php
Code:
 // Check if there is anything to update
        $tmp_rec = $app->dbmaster->queryOneRecord("SELECT count(server_id) as number from sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id = 0)");
Code:
 // Check if there is anything to update
        $tmp_rec = $app->dbmaster->queryOneRecord("SELECT count(server_id) as number from sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id=1 OR server_id = 0)");
/usr/local/ispconfig/server/lib/classes/modules.inc.php
Code:
//* If its a multiserver setup
                if($app->db->dbHost != $app->dbmaster->dbHost) {

                        $sql = "SELECT * FROM sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]."  OR server_id = 0) ORDER BY datalog_id";
Code:
//* If its a multiserver setup
                if($app->db->dbHost != $app->dbmaster->dbHost) {

                        $sql = "SELECT * FROM sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id = 1 OR server_id = 0) ORDER BY datalog_id";
about 30 lines below, near "$app->db->query($sql)"
Code:
$app->db->query($sql)
to
Code:
 if (($d['server_id'] == $conf["server_id"]) OR ($d['server_id'] == 0 ))
  {
    $app->db->query($sql);
   }  else {
     if (($d['dbtable'] == 'dns_rr')  OR ($d['dbtable'] == 'dns_soa') OR ($d['dbtable'] == 'dns_template'))
        {
           $app->db->query($sql);
         }
}
It is now possible to 'clone' config from master to that slave, also pick up updates for this slave (but will not serve them, unless you chose your server_id in mydns.conf). It is possible to break other modules configuration with the above, but I do not run other modules on that slave so I'm not digging deeper for now.

Last edited by Uvigii; 8th January 2010 at 22:47.
Reply With Quote
Sponsored Links