If you're not keen on just rsyncing whole zone files or running other daemons etc, here's a script I wrote to connect a DA server to an existing cPanel DNS cluster. It still needs further work for things in the TODO list but it is functional.
In case there's some people that want to at least know this is easily possible if running mixed cPanel/DA servers and a cPanel cluster, it is.
Config file is separate for easier updating.
Then edit dns_write_post_config.php to put in your cPanel server details, you can add as many as you like, but the checks only connect to the first one (to see if a domain exists, and get existing records, it's assumed that the DNS cluster records all match). Now creating or editing a dns zone in DA will push it to the cPanel cluster servers you defined.
Update: V2 ready, to update just run:
The main change in v2 is that it now compares the zones first, and only deletes/adds new/changed records, which makes it a lot faster.
TODO:
- SOA record handling
- TTL's
In case there's some people that want to at least know this is easily possible if running mixed cPanel/DA servers and a cPanel cluster, it is.
Config file is separate for easier updating.
Code:
cd /usr/local/directadmin/scripts/custom
wget -O /usr/local/directadmin/scripts/custom/dns_write_post.sh https://files.netnerd.com/directadmin/dns_write_post.sh
wget -O /usr/local/directadmin/scripts/custom/dns_write_post_config.php https://files.netnerd.com/directadmin/dns_write_post_config.php.txt
chown diradmin:diradmin dns_write_post.sh && chown diradmin:diradmin dns_write_post_config.php
chmod 700 dns_write_post.sh && chmod 600 dns_write_post_config.php
Then edit dns_write_post_config.php to put in your cPanel server details, you can add as many as you like, but the checks only connect to the first one (to see if a domain exists, and get existing records, it's assumed that the DNS cluster records all match). Now creating or editing a dns zone in DA will push it to the cPanel cluster servers you defined.
Update: V2 ready, to update just run:
Code:
wget -O /usr/local/directadmin/scripts/custom/dns_write_post.sh https://files.netnerd.com/directadmin/dns_write_post.sh
The main change in v2 is that it now compares the zones first, and only deletes/adds new/changed records, which makes it a lot faster.
TODO:
- SOA record handling
- TTL's
Last edited: