Connect DirectAdmin server to cPanel DNS cluster servers

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?

Got the same question – do changes on cPanel DNS only cluster propagate to DA cluster? Thank you!
 
Got the same question – do changes on cPanel DNS only cluster propagate to DA cluster? Thank you!

Good day,
I don't understand, why do you need to have 2 clusters running? DNSOnly and DA?

I had DNSOnly cluster with 2 Cpanel servers separatedly, which used that cluster. For now I have 2 DA servers and 1 Cpanel (it is still under migration), which use same DNSCLuster.

Everything is fine.
 
Good day,
I don't understand, why do you need to have 2 clusters running? DNSOnly and DA?

Good point :) All my NS run on cPanel DNSonly and I was thinking about possibility to replace some or all cPanel DNSonly with DA on my DNS cluster. Guess it is not possible with currently available tools while having cPanel servers on the same NS...

I was also wondering how do solutions on this topic prevent users on DA server from creating (adding)/editing/removing DNS zones that belong to users on cPanel server? Thank you.
 
Hi,

Can this script be modified to work with external cluster of pdns ? We have a 3 server cluster running on pdns.

Thanks
 
I've just updated this to fix numerous bugs I found now we need it for production, got a few more to go but it's a lot more reliable now in case anyone need this.

Let me know if you find any bugs too of course.
 
I've just updated this to fix numerous bugs I found now we need it for production, got a few more to go but it's a lot more reliable now in case anyone need this.

Let me know if you find any bugs too of course.
Hi Nick,
Where can I get the latest version of this? And does it work with powerdns?
 
First post. It works with cpanel DNS clusters
Thanks for the reply. Yes im aware its for CPANEL DNS Clusters, but my Cpanel DNS cluster is running PowerDNS not Bind as attached so I wanted to ensure it works with this setting.
 

Attachments

  • dns.jpg
    dns.jpg
    325.8 KB · Views: 25
We tried this back when we first migrated 8,000 accounts to DirectAdmin and it worked great.

It did the trick while we were moving from cP to DA. After the successful migration, we changed the nameservers to DA and life has been great.

Now we find ourselves in a situation where we want to have multiple control panels sharing the same nameserver clusters and we want to go back to cPanel DNSOnly as the Nameservers.

Here is my question... after I set up the DA servers with the scripts as for the first post, how can I get the existing domain zones from the DA servers onto the cPanel DNSOnly box. I know if I make a change to a zone, it will get updated on the cluster properly, but is there a good way to get the zones there without having to make DNS changes in DA to each of the domains? Maybe a script that would make DNS changes that might also trigger dns_write_post.sh ?

Thanks!
 

echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

I don't know if that will affect any custom records though?
 
you can just copy domain.db files to CPDNSonly and reconfigure it to handle all zones on this server. It should take under control your DA zones too. OR, you can easyly write a script on DA server which will do:
/opt/px-dns-da2cp/px-dns-da2cp.sh sync some.domain


Both ways should work
 

echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

I don't know if that will affect any custom records though?
Hey Nick,

I've tried using the script in the first post. Not seeing any new .db file being created on the cPanel DNS Only server for a new zone. Seems like cPanel server isn't responding to the API calls.

Here is the log:

# cat cpdnslog.txt
A records from DA: array (
0 =>
array (
0 => 'ftp.<DOMAIN>.',
1 => '<IP>',
),
1 =>
array (
0 => '<DOMAIN>.',
1 => '<IP>',
),
2 =>
array (
0 => 'mail.<DOMAIN>.',
1 => '<IP>',
),
3 =>
array (
0 => 'pop.<DOMAIN>.',
1 => '<IP>',
),
4 =>
array (
0 => 'smtp.<DOMAIN>.',
1 => '<IP>',
),
5 =>
array (
0 => 'www.<DOMAIN>.',
1 => '<IP>',
),
)
MX records from DA: array (
0 =>
array (
0 => '<DOMAIN>.',
1 => '10',
2 => 'mail',
),
)
NS records from DA: array (
0 =>
array (
0 => '<DOMAIN>.',
1 => 'ns1.<NS>.',
),
1 =>
array (
0 => '<DOMAIN>.',
1 => 'ns2.<NS>.',
),
)
TXT records from DA: array (
0 =>
array (
0 => '"v=spf1 a mx ip4:<IP> ~all"',
1 => '<DOMAIN>.',
),
)
SRV records from DA: false
check_dns_zone running...
Our cURL url: https://ns0.<NS>:2087/json-api/dumpzone?api.version=1&domain=<DOMAIN>
cPanel server said:

send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
check_dns_zone running...
Our cURL url: https://ns0.<NS>:2087/json-api/dumpzone?api.version=1&domain=<DOMAIN>
cPanel server said:

Records from cPanel:
NULL
DA Clean Records:
array (
0 =>
array (
'type' => 'A',
'name' => 'ftp.<DOMAIN>.',
'address' => '<IP>',
),
1 =>
array (
'type' => 'A',
'name' => '<DOMAIN>.',
'address' => '<IP>',
),
2 =>
array (
'type' => 'A',
'name' => 'mail.<DOMAIN>.',
'address' => '<IP>',
),
3 =>
array (
'type' => 'A',
'name' => 'pop.<DOMAIN>.',
'address' => '<IP>',
),
4 =>
array (
'type' => 'A',
'name' => 'smtp.<DOMAIN>.',
'address' => '<IP>',
),
5 =>
array (
'type' => 'A',
'name' => 'www.<DOMAIN>.',
'address' => '<IP>',
),
6 =>
array (
'type' => 'MX',
'name' => '<DOMAIN>.',
'preference' => '10',
'exchange' => 'mail',
),
7 =>
array (
'type' => 'NS',
'name' => '<DOMAIN>.',
'nsdname' => 'ns1.<NS>',
),
8 =>
array (
'type' => 'NS',
'name' => '<DOMAIN>.',
'nsdname' => 'ns2.<NS>',
),
9 =>
array (
'type' => 'TXT',
'name' => '<DOMAIN>.',
'txtdata' => '"v=spf1 a mx ip4:<IP> ~all"',
),
)
Clean cPanel records:
array (
)
adding new DA record to zone:
array (
'type' => 'A',
'name' => 'ftp.<DOMAIN>.',
'address' => '<IP>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'A',
'name' => '<DOMAIN>.',
'address' => '<IP>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'A',
'name' => 'mail.<DOMAIN>.',
'address' => '<IP>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'A',
'name' => 'pop.<DOMAIN>.',
'address' => '<IP>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'A',
'name' => 'smtp.<DOMAIN>.',
'address' => '<IP>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'A',
'name' => 'www.<DOMAIN>.',
'address' => '<IP>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'MX',
'name' => '<DOMAIN>.',
'preference' => '10',
'exchange' => 'mail',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'NS',
'name' => '<DOMAIN>.',
'nsdname' => 'ns1.<NS>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'NS',
'name' => '<DOMAIN>.',
'nsdname' => 'ns2.<NS>',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
adding new DA record to zone:
array (
'type' => 'TXT',
'name' => '<DOMAIN>.',
'txtdata' => '"v=spf1 a mx ip4:<IP> ~all"',
)
send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:
 
I am brand new to DA and have a basic understanding of DNS, so please forgive me if this is a stupid question.
I could not get the script to work. It does exactly the same as in @justjosh post above, connecting successfully to the cPanel DNS only servers and ending with

send_to_ns running...
cPanel server said:
send_to_ns running...
cPanel server said:

I logged into the DNS ONLY servers and there were no *.db files created in /var/named for the new domain.

So, what I did is simply scp the .db file for the new domain created on my DA testing server to both my cPanel DNS ONLY servers, and then onl those servers did a "Synchronize one zone to all servers" and the new DNS entries are now working on my DNS cluster.

QUESTION:
After creating a new account on my DA server, can't I just rsync the .db files to my two cpanel dns only nameservers and then sync the zones?
This can be added to a cronjob to sync all db every 5 minutes or so?

I have probably overlooked something, but would be grateful for any responses.
 
Great script, thanks! Just one thing - when I delete an account in DA the zone is NOT deleted on the cPanel DNS servers. Is this by design or just a missing functionality? I see earlier in this discussion shvaber posted a custom dns_delete_post.sh to solve this, but their link no longer works. Anyone have a copy, or written a custom dns_delete_post.sh to solve this issue? Thanks a lot
 
In case anyone is interested, I created a dns_delete_post.sh so when a zone is deleted in DA (e.g. when you delete a user/domain), it deletes the zone on the cpanel dns server. See attached file.
 

Attachments

  • dns_delete_post.sh.txt
    4.5 KB · Views: 18
Does this still work?

Im in a process to leave CP for good, but i have my dns cluster un cpanel dns only and i would like to use it so i can migrate my cpanel accounts smooth as possible
 
it still works, I still use cpanelDns as it has WHMAPI, so 4 DNSOnly servers for 5 DA host machines
 
Is there any update on this? I just notice that it is create duplicated entries, i dont know if every xx time or everytime that the user tried to add/delete/modify a zone, as i only have one domain on my DA server i just found that this domain only has 11 entries on DA but in my CP cluster it has more thant 350 duplicated entries :S
 
Back
Top