Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wildcards and the include directive?

2,052 views
Skip to first unread message

Alfie John

unread,
Jan 24, 2012, 3:29:07 AM1/24/12
to bind-...@lists.isc.org
Hi guys,

I've looked hard but can't find any reference to using wildcards inside
an include directive. Does this feature exist in 9?

I've found this setup quite useful for other services like Apache etc.
What I want to do is be able to configure multiple zones by something
like:

include "/etc/bind/sites-enabled/*"

This way, I can add/remove zones on the fly with ln and rm, instead
of resorting to sed/awk/perl in order to modify named.conf.

Alfie

Mark Andrews

unread,
Jan 24, 2012, 3:48:25 AM1/24/12
to Alfie John, bind-...@isc.org
Named supports adding and removing zones via rndc.

rndc addzone ....
rndc delzone ....

> Alfie
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe
> from this list
>
> bind-users mailing list
> bind-...@lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org

SM

unread,
Jan 24, 2012, 3:55:25 AM1/24/12
to bind-...@lists.isc.org
At 00:29 24-01-2012, Alfie John wrote:
>I've looked hard but can't find any reference to using wildcards inside
>an include directive. Does this feature exist in 9?

http://ftp.isc.org/isc/bind9/cur/9.8/doc/arm/Bv9ARM.ch06.html#id2575504

Regards,
-sm

Jan-Piet Mens

unread,
Jan 24, 2012, 3:58:49 AM1/24/12
to bind-...@lists.isc.org
> include "/etc/bind/sites-enabled/*"

That won't work.

What you could do though is to create the content of the file you're
including, which ought to solve your problem.

cd /var/path
ls > /etc/bind/sites-enabled.include

And then in named.conf [ include "/etc/bind/sites-enabled.include" ]

-JP

Alfie John

unread,
Jan 24, 2012, 4:23:39 AM1/24/12
to Mark Andrews, bind-...@isc.org
Hi Mark,

On Tue, Jan 24, 2012 at 07:48:25PM +1100, Mark Andrews wrote:
> Named supports adding and removing zones via rndc.
>
> rndc addzone ....
> rndc delzone ....

Thanks for the pointer. I didn't know about the rndc commands (the man
pages say nothing). However, looking at the online documentation it says
that addzone will add it to the config files. But after running a test,
all this does is add it to the cache. So does this would mean that every
time the cache is purged, I would have to run addzone again?

Alfie

Alfie John

unread,
Jan 24, 2012, 4:24:52 AM1/24/12
to SM, bind-...@lists.isc.org
Hi SM,
Yeah, I've read all that but that doesn't help me with what I want.

Alfie

Alfie John

unread,
Jan 24, 2012, 4:31:44 AM1/24/12
to Jan-Piet Mens, bind-...@lists.isc.org
Hi Jan-Piet,

On Tue, Jan 24, 2012 at 09:58:49AM +0100, Jan-Piet Mens wrote:
> What you could do though is to create the content of the file you're
> including, which ought to solve your problem.
>
> cd /var/path
> ls > /etc/bind/sites-enabled.include
>
> And then in named.conf [ include "/etc/bind/sites-enabled.include" ]

That's actually a nice hack... I like it.

On a more general note, do other people see wildcard includes useful or
is it just me? Would a patch be accepted for this feature or is my
thinking flat-out wrong?

Alfie

Jan-Piet Mens

unread,
Jan 24, 2012, 4:55:31 AM1/24/12
to bind-...@lists.isc.org
> the online documentation it says
> that addzone will add it to the config files. But after running a test,
> all this does is add it to the cache. So does this would mean that every
> time the cache is purged, I would have to run addzone again?

No. Zones are added to / removed from a .nzf "cache" which is created
dynamically by named. I've got a tiny writeup at [1].

-JP

[1] http://jpmens.net/2010/10/04/dynamically-add-zones-to-bind-with-rndc-addzone/

Alfie John

unread,
Jan 30, 2012, 5:34:59 AM1/30/12
to Jan-Piet Mens, bind-...@lists.isc.org
On Tue, Jan 24, 2012 at 10:55:31AM +0100, Jan-Piet Mens wrote:
> > the online documentation it says
> > that addzone will add it to the config files. But after running a test,
> > all this does is add it to the cache. So does this would mean that every
> > time the cache is purged, I would have to run addzone again?
>
> No. Zones are added to / removed from a .nzf "cache" which is created
> dynamically by named. I've got a tiny writeup at [1].

Cool. Thanks for the link.

Alfie

--
Alfie John
http://h4c.kr
0 new messages