HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=29)
-   -   DNS Replication (http://www.howtoforge.com/forums/showthread.php?t=42501)

Uvigii 8th January 2010 22:40

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.

till 10th January 2010 16:35

The above should work and a similar replication mode is already included in SVN and will be released with ISPConfig 3.0.2

lucani 25th January 2010 23:03

What about MyDNS as Master replication to slave Bind ? It still doesnt work, MyDNS reports wrong, older serial of SOA. Even if I change records in zone, serial is changing in MyDNS database but it notifying wrong serial to slaves bind (or maybe it doesnt notify in general)

manarak 1st February 2010 14:45

yes, it still doesn't work with MyDNS, I am waiting on this fix as well.

till 1st February 2010 14:47

Then you should write the mydns developers a email or post in their mailinglist. The problem is that mydns is not sending notifies when a record has been chnaged in the mydns database. Notifies are only sent when you restart mydns.

If you use mydns as master and slave, then replication is working fine as you use mysql replication for this setup. We use this for years without a problem.

manarak 1st February 2010 14:50

are you saying that if mydns is restarted every 5 mins, the problem will go away?

why doesn't ISPC restart MyDNS whenever changes have been made in DNS configuration and if propagation to slave is requested?

till 1st February 2010 15:01

Quote:

are you saying that if mydns is restarted every 5 mins, the problem will go away?
Yes.

Quote:

why doesn't ISPC restart MyDNS whenever changes have been made in DNS configuration and if propagation to slave is requested?
Because the normal ispconfig setup is to use mydns as master and slave and not bind as slave which works flawlessly. Also the restart means that all slaves will get notified for all domains and not just the changed domain, so this can cause load problems on larger systems.

manarak 1st February 2010 15:13

hmm.

thanks for the info.

can you confirm we are talking about
myDNS : http://mydns.bboy.net/
or
myDNS-NG: http://www.mydns.pl/

which one is used?

till 1st February 2010 15:16

Thats the same, take a look at the release dates. mydns-ng is the latest version of the mydns software. As with every software, you should use the latest released stable version, which is mydns-ng.

manarak 1st February 2010 15:44

thanks.
I just upgraded ISPC to 3.0.16 and everything looks fine.

I downloaded v. 1.2.8.27 which was rumored to solve the delegation to bind problem.
Let's check if this is true.

I guess the upgrade for myDNS has to be done manually?
Is there anything I should watch out for or can I just
Quote:

./configure
make
??
it won't break existing DNS entries, will it?


All times are GMT +2. The time now is 05:35.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.