Reload bind9 after subdomain add/ delete

JohnyByk

Verified User
Joined
Mar 7, 2012
Messages
251
Hi.

I have problem with creating/ deleting subdomains. When i add/ delete subdomain from panel bind9 dosen't reload and operation has no effect (old zone is loaded). I must manually reload bind9.

Is any way for auto reload bind9 after subdomain add/ delete (without cron every 2 minutes :])?

Sorry for my english.

Regards
 
You can use a simple script:

Code:
touch /usr/local/directadmin/scripts/custom/dns_write_post.sh

Insert in it:
Code:
#!/bin/bash

service named restart

exit 0;

Save, exit and make it executable:

Code:
chmod 700 /usr/local/directadmin/scripts/custom/dns_write_post.sh

Just for additional information, i use this command (isntead of named restart)
Code:
/usr/sbin/rndc reload

Regards
 
Just a followup:
Note that DA only called restarts to "named" not "bind9".
If your bind9 script is working, but the named scritp (if it's different) is not, then you can just create a link
Code:
cd /etc/init.d
mv named named.old
ln -s bind9 named
so all calls by DA to named trigger the bind9 script.

Check /var/log/messages for any errors regarding the named reload.

Also make sure DA is calling a named reload after you add the subdomains, but looking in:
/var/log/directadmin/system.log

John
 
Back
Top