DNS: rndc for efficient immediate reloads

Version 1.592


New optional directadmin.conf value, with internal defaults: named_rndc=0 named_rndc_addzone=0 ---- ENABLE ./directadmin set named_rndc 1 service directadmin restart Where changes to the dns zone will make use of the 2 possible calls: ----- Changes to the contents of a zone: /usr/sbin/rndc reload domain.com Add or remove zones from the named.conf /usr/sbin/rndc reconfig ----- such that the rndc reload domain is done immediately, without any delay (task.queue is not used for dns in some cases) Other cases, like full rewrites of all zones will still use the old "service named reload", or whatever you've got setup. ====== ADD/DELETE Zones to enable this level, rndc 9.11 and up is needed: rndc --version Basically, CentOS 7 and up. You should also have named_rndc=1 enabled, although they are somewhat separate. ---- ENABLE ./directadmin set named_rndc_addzone 1 service directadmin restart You must also have: allow-new-zones yes; in the options{} section of your named.conf or you'll get a permission denied error. /var/named must also be writable by "named:named" This will make use of the rndc addzone/delzone calls to add/remove the zones. The data/templates/zone.conf should NOT be overly customized (single line only) as it's passed to rndc on the command line. ---- When using the named_rndc_addzone , zones are not stored in the named.conf. The rdnc call automatically adds them to the default view: /var/named/_default.nzf so for any listing of all zones on the box, DA will get the list from both that file and the named.conf. For "does the zone exist", DA will use: rndc zonestatus 'domain.com' and will look for a zero result for true. Else, it will continue to hunt in the named.conf for the zone. ========= TASK.QUEUE For any non-immediate calls, where the task.queue is still used, instead of action=named, it will use: echo "action=rndc&value=reload&domain.com" >> /usr/local/directadmin/data/task.queue or: echo "action=rndc&value=reconfig" >> /usr/local/directadmin/data/task.queue But for any calls pushed to the task.queue, their exact value will still be used. So if you're reloading named through the task.queue, the old service named reload will still be used. ---- T20691

Interested to try DirectAdmin? Get a 30-day Free Trial!