How to set up secondary DNS

Discussion in 'Installation/Configuration' started by bswinnerton, Sep 7, 2008.

  1. bswinnerton

    bswinnerton New Member

    Hi there guys,

    I read somewhere that it is possible to set up ispconfig to automatically update the slave dns in ispconfig. So i just set up a backup server and installed ispconfig on it. How can I configure it so that, whenever I update the dns on my first ispconfig system, it will be updated on the backup server?

    Thanks!
     
    Last edited: Sep 7, 2008
  2. till

    till Super Moderator

    Login to ispconfig in the second server and add there a slave record for a domain that you have on the primary server. ISPConfig (or to be more precise BIND) will now copy the zone via zone transfer to the slave server and will keep it up to date.
     
  3. grandpagenocide

    grandpagenocide ISPConfig Developer

    Till,
    So for a secondary dns server each slave record has to be setup manually? or is there a way for it to autocreate the slave record when master is created?
     
  4. till

    till Super Moderator

    Yes.

    No. I guess it should be possible to use e.g. the remoting framework to add a slave record on the secondary server when a primary record is added on the master by adding the code for a remoting call in the file /home/admispconfig/ispconfig/lib/classes/ispconfig_isp_dns.lib.php

    e.g add on line 440:
    Code:
    if($aufruf == 'soa' && is_file('/home/admispconfig/ispconfig/lib/slavedns.php')) include('/home/admispconfig/ispconfig/lib/slavedns.php');
    
    Then create a new file /home/admispconfig/ispconfig/lib/slavedns.php

    and inside the file add the code for the remoting call. You will find all information about the dns record (e.g. domain name etc.) in the variable $soa. The $soa variable contains the record from the database table dns_isp_dns, so that the domain name can be accessed with $soa['dns_soa']
     

Share This Page