Slave DNS for multiple primary DNS

Discussion in 'Installation/Configuration' started by spazio, Sep 7, 2016.

  1. spazio

    spazio Member HowtoForge Supporter

    Hi All,
    With these tutorials in mind:
    https://www.howtoforge.com/multiser...se-servers-on-debian-squeeze-with-ispconfig-3
    https://www.howtoforge.com/how-to-r...and-secondary-with-ispconfig-3-debian-squeeze

    Let say I have two complete server with web,mail,db,dns and one multiple server setup (one web, one mail, one db, one dns)
    In total I have 3 server setup. with one containing 4 physical servers. In this scenario I should have 3 physical secondary dns server.
    BUT I DON'T WANT TO MANAGE 3 DNS2 servers. I want to merge the 3 into one.

    Is there a way to have one secondary dns that will be the replication/slave of the 3 first primary dns? With ispconfig or manually.
    If yes, how? Any suggestion would be appreciated.

    Thanks for all inputs.
    spazio
     
  2. dasky

    dasky New Member

    Hi,

    I have a similar set up. 2 primary DNS server and one secondary serving both primary.
    I just installed a simple Debian system with BIND and managing the zones manually from Webmin. Very easy to add secondary zones using Webmin, takes only a few seconds. You just need to set up the zone (domain name) and the name server (IP). However it is a manual process.

    dasky
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    You can do the same in ispconfig, so no need for webmin. It is named a slave zone, just add a the zones as secondary dns record in the dns manager. What you can't use is the automatic mirroring of ispconfig servers.
     
    dasky likes this.
  4. spazio

    spazio Member HowtoForge Supporter

    I'm messing around with the mirroring feature but I can't seem to get it up and running!

    I think my problem is from the fac that the second server is behind a router with NAT! The first one is on a public ip. There is no port block by the isp and it's a fix IP. So the server2 has a private IP and the router is NATING the ports to the ispconfig server2. But they are not the standard ports because I have a server there. ( it will be replaced by the new one) so http=81 https=444 ssh=220 and so...

    How the modifications made on the master ispconfig server are push on the slave ispconfig server?
    How can I test that communication?
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    The master doesn't push anything to the slaves, so no issues there. What you need is the slave to be able to talk to the mysql server on the master (most likely tcp port 3306), and it will read in the changes that it needs to make locally.
     
  6. spazio

    spazio Member HowtoForge Supporter

    Ok that's what I taught but here are the test I made:
    I added the the user and reverse dns for the wan nat IP on the master server.
    If I try to connect to the master server with credentials from :
    /usr/local/ispconfig/server/lib/config.inc.php under the section,
    //** Database settings for the master DB. This setting is only used in multiserver setups

    It works, I have access. I can use the database dbispconfig and show some of the tables

    Database changed
    MariaDB [dbispconfig]> show tables;
    +-----------------------+
    | Tables_in_dbispconfig |
    +-----------------------+
    | aps_instances |
    | dns_soa |
    | mail_traffic |
    | sys_datalog |
    | sys_group |
    | sys_remoteaction |
    | web_traffic |
    +-----------------------+
    7 rows in set (0.04 sec)

    MariaDB [dbispconfig]>

    But when I run /usr/local/ispconfig/server/server.sh
    I get,
    root@server2:/usr/local/ispconfig/server/temp# /usr/local/ispconfig/server/server.sh
    Unable to load the server configuration from database.
    root@server2:/usr/local/ispconfig/server/temp#

    I'm a bit lost and don't exactly know where is the problem. Any comments would be appreciated.
     
  7. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    The database contains a lot of more tables. You can try to rebuild the structure on this server.
     
  8. spazio

    spazio Member HowtoForge Supporter

    How would you do that? Is there a way to force ispconfig_update.sh to execute event if it's the uptodate version?

    Both server1 and server2 have 79 tables! That's the view from the server2 with user 'ispcsrv2'@'reverse_dns_name_of_ip' !
    same command from server1 is:
    Database changed
    MariaDB [dbispconfig]> show tables;
    +--------------------------+
    | Tables_in_dbispconfig |
    +--------------------------+
    | aps_instances |
    | aps_instances_settings |
    | aps_packages |
    | aps_settings |
    | attempts_login |
    | client |
    | client_circle |
    | client_message_template |
    | client_template |
    | client_template_assigned |
    | country |
    | cron |
    | directive_snippets |
    | dns_rr |
    | dns_slave |
    | dns_soa |
    | dns_template |
    | domain |
    | firewall |
    | ftp_traffic |
    | ftp_user |
    | help_faq |
    | help_faq_sections |
    | iptables |
    | mail_access |
    | mail_backup |
    | mail_content_filter |
    | mail_domain |
    | mail_forwarding |
    | mail_get |
    | mail_mailinglist |
    | mail_relay_recipient |
    | mail_traffic |
    | mail_transport |
    | mail_user |
    | mail_user_filter |
    | monitor_data |
    | openvz_ip |
    | openvz_ostemplate |
    | openvz_template |
    | openvz_traffic |
    | openvz_vm |
    | remote_session |
    | remote_user |
    | server |
    | server_ip |
    | server_ip_map |
    | server_php |
    | shell_user |
    | software_package |
    | software_repo |
    | software_update |
    | software_update_inst |
    | spamfilter_policy |
    | spamfilter_users |
    | spamfilter_wblist |
    | support_message |
    | sys_config |
    | sys_cron |
    | sys_datalog |
    | sys_dbsync |
    | sys_filesync |
    | sys_group |
    | sys_ini |
    | sys_log |
    | sys_remoteaction |
    | sys_session |
    | sys_theme |
    | sys_user |
    | web_backup |
    | web_database |
    | web_database_user |
    | web_domain |
    | web_folder |
    | web_folder_user |
    | web_traffic |
    | webdav_user |
    | xmpp_domain |
    | xmpp_user |
    +--------------------------+
    79 rows in set (0.00 sec)

    MariaDB [dbispconfig]> exit

    I think the problem is in the server name/wan ip/private IP/reverse_dns_name_of_wan_ip!
    It's mentionned every where that the /etc/hosts need the right name and ip of both server1 and server2!
    But in my case whitch of those do I use? server name/wan ip/private IP/reverse_dns_name_of_wan_ip
    And what change needs to be done in the databases? Server1 and server2 to match those?
     
  9. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Assuming both your servers are behind the same nat (they probably are), edit /etc/hosts on both of them and put entries for the private ip and hostname of both. Eg. both should have something like:
    Code:
    192.168.101.111  server1.domain.com  server1
    192.168.101.222  server2.domain.com  server2
    Then on your master server (server1) make sure you have a mysql.users table entry for 'root' user for both the hostname (server2.domain.com) and ip (192.168.101.222). After you've checked that, re-run the ispconfig update script and answer yes when it asks to configure permissions in the master server (it will create the correct users/tables_priv entries for the 'ispcsrv2' user).
     
    Last edited: Sep 26, 2016

Share This Page