RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1315821 - rndc addzone/delzone unusable due to RPM packaging or missing BIND configuration option
Summary: rndc addzone/delzone unusable due to RPM packaging or missing BIND configurat...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: bind
Version: 7.2
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Petr Menšík
QA Contact: Petr Sklenar
URL:
Whiteboard:
: 1572374 (view as bug list)
Depends On: named_writable_home 1572647 1633158
Blocks: 1298243 1380362 1393869 1420851 1465887 1465928 1477664 1534569 1549614
TreeView+ depends on / blocked
 
Reported: 2016-03-08 17:17 UTC by Robert Scheck
Modified: 2021-12-10 14:36 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:18:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
bind9.9 new-zones-directory patch (7.61 KB, patch)
2017-03-10 17:15 UTC, Petr Menšík
no flags Details | Diff
bind 9.9. new-zones-directory patch with legacy (15.36 KB, patch)
2017-03-22 12:06 UTC, Petr Menšík
no flags Details | Diff
new-zones-directory patch (22.80 KB, patch)
2017-10-05 16:12 UTC, Petr Menšík
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3425391 0 None None None 2018-04-27 09:19:57 UTC
Red Hat Product Errata RHBA-2018:3136 0 None None None 2018-10-30 10:19:49 UTC

Description Robert Scheck 2016-03-08 17:17:55 UTC
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 :)

Comment 1 Robert Scheck 2016-03-08 17:19:56 UTC
Cross-filed case 01597035 on the Red Hat customer portal.

Comment 2 Robert Scheck 2016-03-08 17:23:00 UTC
Just to clarify: The issue is not the zonefile itself, but the NZF file that
is managed by addzone/delzone.

Comment 4 Tomáš Hozza 2016-04-05 08:57:40 UTC
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.

Comment 5 Robert Scheck 2016-04-05 09:03:13 UTC
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.

Comment 6 Tomáš Hozza 2016-04-05 09:54:28 UTC
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.

Comment 10 Robert Scheck 2016-11-09 16:35:16 UTC
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).

Comment 15 Petr Menšík 2017-03-10 17:15:56 UTC
Created attachment 1262015 [details]
bind9.9 new-zones-directory patch

Prepared patch to add new-zones-directory. Reported to ISC as [ISC-Bugs #44853]

Comment 19 Petr Menšík 2017-03-22 12:06:57 UTC
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.

Comment 21 Robert Scheck 2017-04-11 17:43:27 UTC
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.

Comment 25 Petr Menšík 2017-10-04 20:50:56 UTC
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].

Comment 26 Petr Menšík 2017-10-05 16:12:45 UTC
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.

Comment 30 Robert Scheck 2018-02-25 17:06:40 UTC
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 :)

Comment 32 Petr Menšík 2018-04-27 09:19:57 UTC
*** Bug 1572374 has been marked as a duplicate of this bug. ***

Comment 40 errata-xmlrpc 2018-10-30 10:18:33 UTC
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


Note You need to log in before you can comment on or make changes to this bug.