Hide Forgot
Description of problem: Running "rndc addzone" or "rndc delzone" is unusable due to RPM packaging or due to a missing BIND configuration option: According to https://ftp.isc.org/isc/bind/9.8.0-P4/doc/arm/Bv9ARM.ch03.html, "rndc addzone" generates a configuration file named /var/named/hash.nzf, but the directory can't be configured. The RPM packaging is, that /var/named is not writable for named - and the directory to be used for this NZF option does not seem to be configurable in BIND. Touching the (predictable) filename with proper permissions helps to add a new zone, however not while removing it again, thus it is not acceptable as a workaround to create the file itself with proper permissions, but these need to be correct on the parent level. Given the default /var/named might be a bad place, this maybe should get a configuration option? Version-Release number of selected component (if applicable): bind-9.9.4-29.el7_2.2.x86_64 How reproducible: Everytime, see above and below. Steps to Reproduce: 1. Install BIND via yum as usual, keep everything on defaults 2. setsebool named_write_master_zones=1 3. Ensure "allow-new-zones" option to be set to "yes" 4. Run "rndc addzone example.com '{ type master; file "example.com.db"; };'" 5. Get the error that the NZF file can't be written Actual results: Running rndc addzone/delzone unusable due to RPM packaging or missing BIND configuration option. Expected results: Running rndc addzone/delzone working as expected :)
Cross-filed case 01597035 on the Red Hat customer portal.
Just to clarify: The issue is not the zonefile itself, but the NZF file that is managed by addzone/delzone.
Hello. Thank you for reporting this bug. The fact that /var/named/ is not writable by default by named group is intentional. The reason is to restrict write access only to root and in case the administrator wants to make it writable also to named group, they have to make a conscious decision. You can argue that there is the SELinux variable you have to set. While this is true, Not everybody uses SELinux and therefore the filesystem permissions are used as a general way do restrict the write access only to root. Some old references on why it is so: https://bugzilla.redhat.com/show_bug.cgi?id=125518#c10 https://bugzilla.redhat.com/show_bug.cgi?id=126638#c6 In case you find the documentation provided by Red Hat incomplete I can extend it to discuss also this situation. However I don't consider the current state a Bug, since it is intentional. Also for the reasons described above I'm reluctant to changing the permissions to writable by named group. Please note that the default configuration shipped by Red Hat configures BIND as a local validating recursive resolver, not as an authoritative server. So as a first step I thing we can provide better documentation on what needs to be changed for this use case. As a second step I'll contact upstream and see if they would be willing to have a configuration option for specifying where are the .nzf files created. However this will be considered a Feature request. I'm also not sure if upstream will accept such change.
Thomas, thanks for your verbose reply. I agree that /var/named/ should be not writable by default and a configuration option would be better. The raised issue is not a documentation one. I understand that the default configuration as shipped with RHEL is different from the usecase, but given it's a BIND, it simply can be configured to act as authoritative server. Martin Osvald already spent some time with this - no matter if he was in touch with you or not. If not, please get in touch with him first to avoid double efforts for the same.
Thanks for the reply Robert. Martin, co you have some draft of the patch? In the customer case I saw that you are working on something. Thank you in advance.
I am aware about the current ticket status, but I wonder about the patch that was mentioned, I'm also happy to test something or similar (note, this is just about technical stuff, not organisational).
Created attachment 1262015 [details] bind9.9 new-zones-directory patch Prepared patch to add new-zones-directory. Reported to ISC as [ISC-Bugs #44853]
Created attachment 1265360 [details] bind 9.9. new-zones-directory patch with legacy Modified patch that will use files in default directory if they do not exist in new-zones-directory. That should simplify upgrade of default configuration significantly. Provides also basic unit test.
I got bind-9.9.4-38.el7_3.3.test.x86_64 via GSS for testing. Not sure if that package contains the latest version of the patch, but after adding allow-new-zones yes; to /etc/named.conf, any restart of BIND (without any zone created etc.) leads to this (new) log entry: Apr 11 19:39:25 tux named[1287]: open: 3bf305731dd26307.nzf: file not found Further, once I add new-zones-directory "/var/named/dynamic"; additionally to /etc/named.conf, any restart of BIND (without any zone created etc.) leads to this (new) log entry: Apr 11 19:37:18 tux named[1258]: open: ↲ /var/named/dynamic/3bf305731dd26307.nzf: file not found Not sure if this is really intended. Aside from this, "rndc addzone" and "rndc delzone" seems to work as expected.
Hello, I am sorry for late reply. new-zones-directory was merged upstream in bug https://bugs.isc.org/Public/Bug/Display.html?id=44853 I backported sligtly different version to match upstream more closely. However logged errors are still present also in latest bind, reported as bug [ISC-Bugs #46186].
Created attachment 1334898 [details] new-zones-directory patch Upstream version of patch, corrects also logging of errors when allow-new-zones is set to yes, but nzf files are not yet created.
Petr, given [ISC-Bugs #46186] is not public, can you please report here whether it is resolved or not? If not, could you create a public clone at gitlab.isc.org, please? Thanks :)
*** Bug 1572374 has been marked as a duplicate of this bug. ***
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3136