[Unbound-users] Patch: wildcard for include: statement

Paul Wouters paul at nohats.ca
Sat Apr 13 21:16:37 UTC 2013

On Sat, 13 Apr 2013, Robert Edmonds wrote:

> i've tried to add similar functionality to the unbound debian package by
> adding this line to our default config:
>    include: "/etc/unbound/conf.d/*.conf"
> and shipping an empty /etc/unbound/conf.d directory in the package for
> users to place local config.  unfortunately, without any filename
> matches, glob() returns GLOB_NOMATCH and this causes config file parsing
> to fail:
>    /etc/unbound/unbound.conf:17: error: cannot open include file '/etc/unbound/conf.d/*.conf': No such file or directory
>    read /etc/unbound/unbound.conf failed: 1 errors in configuration file
> this goes away if i put at least one file that matches the glob into
> that directory, but i don't want to have to ship a dummy empty
> "do-not-remove.conf" file in the conf.d directory in order to get the
> config to parse correctly (what if the user removes it?).  could this
> feature be updated so that a lack of glob matches is treated as
> "success, but no files included" rather than failure to parse the
> config?  (possibly made contingent on the existence of the directory of
> the dirname() of the wildcarded include: parameter.)

What I did was put commented out examples (example.com.conf,
example.comf.key) in those directories. Without those, the users will
have a hard time figuring out the syntax anyway.

eg I have example.com.conf:

# Example of an override of the "public DNS tree" with an "internal view"
# override, for example to add an internal-only corporate DNS zone.
# The stub-zone/stub-addr must point to AUTHORITATIVE servers. If you want to
# point to an internal RECURSIVE server, use forward-zone/forward-addr instead.

#	name: example.com
#	stub-prime: no
#	# if you could trust a lookup, use:
#	stub-host: a.iana-servers.net.
#	stub-host: b.iana-servers.net.
#	# else specify the IP's using:
#	stub-addr:
#	stub-addr: 2001:500:8c::53
#	stub-addr:
#	stub-addr: 2001:500:8d::53

More information about the Unbound-users mailing list