Skip to main content

Change cPanel DNSOnly to write to _default.nzf instead of named.conf

Comments

4 comments

  • cPRex Jurassic Moderator
    Hey there! I don't know of a way to change that behavior, as that is the way the cluster and DNS system is hard coded. Could you create a tool that copies the data you need to the _default.nzf file, instead of trying to change the cPanel behavior directly?
    0
  • MoreDakka
    Now we get to introduce another problem. Since the systems write in different places then the checks to see if a domain exists doesn't work causing a very ugly situation if bind needs to restart and there are duplicates. Is there a way to change the location that rndc addzone writes? Maybe get that to write to named.conf instead of _default.nzf?
    0
  • cPRex Jurassic Moderator
    I know from a cPanel standpoint, that isn't possible. It might be best to see if the _default.nzf file is compatible with /etc/named.conf as you could then just create a symlink, but there isn't going to be a way to change the cPanel DNS behavior.
    0
  • MoreDakka
    cPRex, took your advice and created an include in the /etc/named.conf file. Here is a blurb I wrote in our KB for this situation: Maybe this can help someone else looking for this info, I'm certain we aren't the only cPanel(linux) and Plesk(windows) shop that wants a shared DNS cluster. The only problem we can think of with this is if there is ever an update to the Slave DNS module and that updated removes the .db edit. SlaveDNS might re-sync the zones without the .db and cause duplicates causing bind to fail if it was restarted. Waiting on Plesk support to see about that. Was thinking of making that file read only? When cPanel writes a DNS record to the cPanel DNSOnly servers it creates a file like this: /var/named/pleskdomain.com.db Plesk SlaveDNS writes them like this: /var/named/pleskdomain.com The records need to have the .db on them to be recognized by the cPanel DNSOnly cluster. To fix, on the Window plesk server (make sure it's set to use Bind): The file name is defined by file C:\Program Files (x86)\Plesk\admin\plib\modules\slave-dns-manager\library\Rndc.php. Change
    " \"{ type slave; file \\\"{$domain}\\\"; masters { {$slave->getMasterPublicIp()}; }; };\"");
    To
    " \"{ type slave; file \\\"{$domain}.db\\\"; masters { {$slave->getMasterPublicIp()}; }; };\"");
    afterwards the files are generated with ".db" suffix:
    -rw-r--r-- 1 named named 949 Sep 5 05:39 pleskdomain.com.db
    -rw-r--r-- 1 named named 936 Sep 5 03:47 pleskdomain.com
    You will also need to edit the /etc/named.conf to add: include "/var/named/_default.nzf"; That will make it so Plesk SlaveDNS module doesn't overwrite the domain when it tries to run rndc addzone. No errors happen, it just doesn't do anything, it would be nice if it errored.
    0

Please sign in to leave a comment.