Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 63

Thread: Connect DirectAdmin server to cPanel DNS cluster servers

  1. #41
    Join Date
    Jul 2019
    Posts
    8
    I am using cpanel dnsonly as dns cluster and use this script.
    I do account migration from cpanel to DA. Account has been restored, but there was no MX record in the zone file on dnsonly server.

    cpdnslog.txt:

    Code:
    MX records from DA: array (
      0 =>
      array (
        0 => 'domain.com.',
        1 => '10',
        2 => 'mail',
      ),
    )
    MX records from DA: array (
      0 =>
      array (
        0 => 'domain.com.',
        1 => '10',
        2 => 'mail',
      ),
    MX records from DA: array (
      0 =>
      array (
        0 => 'domain.com.',
        1 => '0     domain.com.',
        2 => NULL,
      ),
    )
    MX records from DA: array (
      0 =>
      array (
        0 => 'domain.com.',
        1 => '0     domain.com.',
        2 => NULL,
      ),
    )
    MX records from DA: array (
      0 =>
      array (
        0 => 'domain.com.',
        1 => '0     domain.com.',
        2 => NULL,
      ),
    )
    And from cpanel error_log
    info [xml-api] Invalid DNS record: Supplied exchange for MX record is invalid [addzonerecord] version [1].
    info [xml-api] Invalid DNS record: Invalid name provided. [addzonerecord] version [1]
    line 87-88, preference should be integer.
    Last edited by susanID; 08-09-2019 at 08:16 PM. Reason: add error_log from cpanel dnsonly

  2. #42
    Join Date
    Aug 2019
    Posts
    24
    Quote Originally Posted by nick-a View Post
    Right I was trying to get TTL values done for the next release, but I don't think it's going to be possible due to the lack of parameters in the env variables.
    it is impossible to get proper TTL for any row in DNS zone, but, as I already checked, zone SERIAL changes on cpanel-side and on DA-side same time after zone added/edited. So you don't need to set up 300 for TTL. I modified the script and changed 300 to 14400, as of this DA-api doesn't let me know exact ttl for every row.

  3. #43
    Join Date
    Aug 2019
    Posts
    8

    directadmin servers with cpanel dnsonly cluster

    Hi everyone,
    I wrote a different approach to run directadmin servers with cpanel dnsonly cluster.

    You can download it here.
    https://github.com/promek/px-dns-da2cp

    Every time a change is made in DNS, refreshing slows down usage.
    so I chose to use at job. your changes are synchronized after 5 min.

    Since dns records are very diverse, I updated the direct /var/named/dnsfile.db file with rsync instead of checking the records one by one.

    This approach seems more useful.
    I hope you will like it.

  4. #44
    Join Date
    Aug 2019
    Posts
    24
    Quote Originally Posted by ibrahim View Post
    Hi everyone, I wrote a different approach ...
    Looks intresting, have you tested it with PowerDNS on Cpanel-side? Does rndc update all stuff?

    Thanks a lot for this solution!

  5. #45
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by shvaber View Post
    Looks intresting, have you tested it with PowerDNS on Cpanel-side? Does rndc update all stuff?

    Thanks a lot for this solution!
    Hi,

    will not work with powerdns. Because the script synchronizes the file in /var/named.

    as far as cpanel works dnsonly just bind.

    Zone reload is added with rndc command.

  6. #46
    Join Date
    Aug 2019
    Posts
    24
    Quote Originally Posted by ibrahim View Post
    Hi everyone,
    I wrote a different approach ...
    Also please add sshpass package to your YUM-section in README

  7. #47
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by shvaber View Post
    Also please add sshpass package to your YUM-section in README
    I added
    Thanks.

  8. #48
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by shvaber View Post
    Looks intresting, have you tested it with PowerDNS on Cpanel-side? Does rndc update all stuff?

    Thanks a lot for this solution!
    will not work with powerdns.
    Because the script synchronizes the file in /var/named.
    as far as cpanel works dnsonly just bind.

    Zone reload is added with rndc command.

  9. #49
    Join Date
    Aug 2019
    Posts
    24
    Why do you think CPANEL DNSONLY works with just BIND? It has PowerDNS too.

  10. #50
    Join Date
    Jul 2019
    Posts
    8
    I got solution for MX problem, line 86:
    Code:
      $rec2 = explode(" ",$rec_arr[1]);
    replace with preg_split:
    Code:
      $rec2 = preg_split('/[\s]+/',$rec_arr[1]);

  11. #51
    Join Date
    Aug 2019
    Posts
    5
    Does anyone know if there's a way to resync a DNS zone into the cPanel DNS clusters for a domain name via SSH / terminal?

  12. #52
    Join Date
    Aug 2019
    Posts
    24
    you can resync zone using any solution from this two: provided by topic starter or by ibrahim

  13. #53
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by shvaber View Post
    Why do you think CPANEL DNSONLY works with just BIND? It has PowerDNS too.
    I have installed systems working with bind. I don't have a system installed with powerdns.
    When I have time I will try to make a setup that works with powerdns.
    I'll see if I can write a script that works with powerdns.

  14. #54
    Join Date
    Jul 2019
    Posts
    20
    Quote Originally Posted by ibrahim View Post
    Hi everyone,
    I wrote a different approach to run directadmin servers with cpanel dnsonly cluster.

    You can download it here.
    https://github.com/promek/px-dns-da2cp

    Every time a change is made in DNS, refreshing slows down usage.
    so I chose to use at job. your changes are synchronized after 5 min.

    Since dns records are very diverse, I updated the direct /var/named/dnsfile.db file with rsync instead of checking the records one by one.

    This approach seems more useful.
    I hope you will like it.
    Works perfectly for me, wish there was a way to use the access hash

  15. #55
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by Sab View Post
    Works perfectly for me, wish there was a way to use the access hash
    dnsonly record insertion and deletion can be done using api.
    but it is necessary to use ssh for rsync file.
    so I took all the operations on ssh.

  16. #56
    Join Date
    Jul 2019
    Posts
    7
    Quote Originally Posted by ibrahim View Post
    dnsonly record insertion and deletion can be done using api.
    but it is necessary to use ssh for rsync file.
    so I took all the operations on ssh.
    Hi Ibrahim,

    When the script runs, it does the update on cpanel dns only but gives error as;

    rndc: 'reload' failed: not found
    rndc: 'reload' failed: not found

    I got 2 cpanel dns only that's why errors are 2 times. Server is Centos 7.6. how can i solve it?

  17. #57
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by troya View Post
    Hi Ibrahim,

    When the script runs, it does the update on cpanel dns only but gives error as;

    rndc: 'reload' failed: not found
    rndc: 'reload' failed: not found

    I got 2 cpanel dns only that's why errors are 2 times. Server is Centos 7.6. how can i solve it?
    Hi,
    there must be a similar situation.
    https://github.com/promek/px-dns-da2cp/issues/4

  18. #58
    Join Date
    Jul 2019
    Posts
    7
    Thank you for the response Ibrahim.

    While i am doing so many dns changes in DA server, i received error from DA root;

    ssh: Could not resolve hostname ns2.xxx.com: Name or service not known
    ssh: Could not resolve hostname ns2.xxx.com: Name or service not known
    ssh: Could not resolve hostname ns2.xxx.com: Name or service not known
    rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]

    However, both ns1 and ns2 was up and running.

    There might be only some time DA could not access to one of dns in the cluster.

    Is there anyway I can initiate a sync for all dns zones from DA to both cpanel dns only?


    Quote Originally Posted by ibrahim View Post
    Hi,
    there must be a similar situation.
    https://github.com/promek/px-dns-da2cp/issues/4

  19. #59
    Join Date
    Aug 2019
    Posts
    8
    Quote Originally Posted by troya View Post
    Thank you for the response Ibrahim.

    While i am doing so many dns changes in DA server, i received error from DA root;

    ssh: Could not resolve hostname ns2.xxx.com: Name or service not known
    ssh: Could not resolve hostname ns2.xxx.com: Name or service not known
    ssh: Could not resolve hostname ns2.xxx.com: Name or service not known
    rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]

    However, both ns1 and ns2 was up and running.

    There might be only some time DA could not access to one of dns in the cluster.

    Is there anyway I can initiate a sync for all dns zones from DA to both cpanel dns only?

    /opt/px-dns-da2cp/config.sh You should check the settings in the file.

    for syncronization from ssh terminal
    /opt/px-dns-da2cp/px-dns-da2cp.sh sync xxx.com

    or

    directadmin interface can be synchronized by editing and saving individual domains from the DNS Administration section.
    Last edited by ibrahim; 09-08-2019 at 04:17 PM.

  20. #60
    Join Date
    Oct 2019
    Posts
    18

    DirectSlave or this?

    Coming over from cPanel DNSOnly cluster, this looks good because the zones look like a nightmare to move to DirectSlave. However, from what I see, it seems like the DNS transfer is only one way? If I delete the zone file on the the NS, the changes would not propagate backwards to the DA servers?

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •