Change ip for primary server and then resync the secondary DNS

Discussion in 'ISPConfig 3 Priority Support' started by tr909192, Jul 10, 2018.

  1. tr909192

    tr909192 Member HowtoForge Supporter

    Dear,

    we have the following setup: primary DNS server (managed with ispconfig) and then a secondary DNS server (always managed with ispconfig).
    Both are inside a master-slave configuration.

    Yesterday we have changed the ip of the primary DNS server, and that was fine with a query on the master db, and then resynced all the zones.
    However we have got a problem on the secondary one. Because we need also on the secondary DNS server change the ip of the primary obviously, but we don't see the option to resync the secondary configuration (aka named.conf.local) via ispconfig control panel. Basically does not exist the secondary DNS server on the dropdown related to resync the DNS zone.

    What is the best way to have the secondary DNS configuration (aka named.conf.local) updated with the new ip?

    thank you
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    When you resync the primary, then the secondary gets resynced automatically. If this did not happen, then the secondary is probably not connected to the master anymore, e.g. because you changed the IP of the primary server and the secondary has the old IP of the primary still in /etc/hosts file.
     
  3. tr909192

    tr909192 Member HowtoForge Supporter

    thank you for your reply
    the slave dns is connected to the master. infact creating a new zone works fine.
    i try to explain better. We changed the IP of master. therefore we have to update the IP of master on the database with a query like this
    update dns_slave set ns="newip" where ns="oldip";
    this query changes ip on the master database. Now we should "resync" this in a way that this is reflected on slave server (so slave dns) and therefore on the named.conf.local on the secondary. This sync appears not to be possible. therefore we seem to be forced to rexecute manually same query on the secondary database and update the named.conf manually on the secondary.
    Is there an automated way or smarter one?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Using Tools > Resync > DNS and selecting the master there should sync master and slave as the slave does always the same than the master.
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Is the secondary DNS server in ISPConfig a mirror of the first dns server?
    Or have you created the secondary server as slave of the master and DNS itself does the copying of zone data?
    It is not clear from your description which way you have done the setup.
     
  6. tr909192

    tr909192 Member HowtoForge Supporter

    you mean if in system->server services->"is mirror of" is set? The answer is no
    the secondary DNS is a secondary DNS in terms of DNS and it's a slave of ispconfig in its master/slave config.
    am i wrong therefore?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    If 'is mirror of' is not set, then the second server must be listed under Tools > Resync in the dns server list, so you can select it there and choose to resync the DNS data.
     
  8. tr909192

    tr909192 Member HowtoForge Supporter

    infact, but no in that list this secondary server does not appear. it just appear the primary
    should i set it as mirror? i think this set should not be correct since this is not a mirror but just secondary dns
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Basically, it depends on how you setup and use the system. The mirror state may not be changed after initial installation, so do not change it, the change would corrupt your setup. Normally, a dns slave server is a mirror, that's the way it is installed in all multiserver (master/slave) setup guides that we published. But you might have chosen a different kind of setup for your servers than the one we describe in the installation instructions.

    How do you get the dns slave data on the second server then if you want that this server handles a zone?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Your servers use ISPConfig 3.1.12 and not an older version, right?
     
  11. tr909192

    tr909192 Member HowtoForge Supporter

    yes 3.1.12
    at the moment when we update a zone on primary it gets replicated correctly on the secondary. all is fine.
    the problem has arised just today because we changed ip of primary. after such a change new zones works fine, but if we change the IP of primary on database with this query
    update dns_slave set ns="newip" where ns="oldip";
    being no resync option, we see that the named.conf of secondary server does not get updated. we shall need to do same query on slave and update the file manually
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    I did a quick look into the ispconfig sources, seems as if the resync function can resync master zones only at the moment, so you will have to do the change manually for the slave zones.
     
    tr909192 likes this.
  13. tr909192

    tr909192 Member HowtoForge Supporter

    Ok we have managed to manually "sync" the secondary zone. Thank you
     
    till likes this.

Share This Page