Skip to content

Fixes for #5449: Add include directory for custom BIND options - #5588

Open
maloo1 wants to merge 1 commit into
opnsense:masterfrom
maloo1:master
Open

Fixes for #5449: Add include directory for custom BIND options#5588
maloo1 wants to merge 1 commit into
opnsense:masterfrom
maloo1:master

Conversation

@maloo1

@maloo1 maloo1 commented Jul 29, 2026

Copy link
Copy Markdown

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

If AI was used, please disclose:

  • Model used:
  • Extent of AI involvement:

Describe the problem

There are a number of cases where it would be nice to add custom options to bind.
One of these is to enable DoT forwarders.


Describe the proposed solution

this solution is an extension on #4773 to add a directory to allow custom bind options to be added


Related issue

This change closes #5449, #5546 and #1715

@maloo1 maloo1 changed the title Fixes for #5339: Add include directory for custom BIND options Fixes for #5449: Add include directory for custom BIND options Jul 29, 2026
Comment on lines +50 to +51
if (count(glob('/usr/local/etc/namedb/named.conf.d/*')) > 1
or count(glob('/usr/local/etc/namedb/named-options.conf.d/*')) > 1) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a different glob on the directories than in the include statements is a bit odd and leads to a warning message, even though no config file actually gets included.

Yes, it is the same pattern as in #4773, but should be fixed in both places.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cm-rudolph - Thanks for taking a look, I'm not sure I understand what you mean though? There are two include directories the new one I've added for options on line 12: include "/usr/local/etc/namedb/named-options.conf.d/*.conf";
And the existing one added in #4773 on line 116:
include "/usr/local/etc/namedb/named.conf.d/*.conf";

I have tested the following on my setup:

  1. No added config changes in the include dirs: No warning is displayed
  2. Added a file to the new options include dir: The warning gets displayed
  3. Also added a file to the old include dir: The warning is still displayed
  4. Removed the added file from the new options include dir: The warning is still displayed (because of tge file in the existing include dir)
  5. Removed both added files: No warning is displayed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @maloo1,

let's assume somebody stores some configuration options in /usr/local/etc/namedb/named-options.conf.d/myoption. The UI would indicate that some manual config probably overwrites config from the UI. But the myoption file isn't loaded, due to the missing .conf file extension.

Line 50 and 51 should read (untested):

        if (count(glob('/usr/local/etc/namedb/named.conf.d/*.conf')) > 1 
            or count(glob('/usr/local/etc/namedb/named-options.conf.d/*.conf')) > 1) {

Best regards
Christian

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thank you @cm-rudolph now I understand! I'll update and test tomorrow, but it will need to be > 0 (since in #4773 and my change we were accounting for the README.txt!!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

os-bind: Add include directory for custom options (named.conf)

2 participants