rndc changezone

Evan Hunt each at isc.org
Tue Jul 8 21:05:51 UTC 2014


On Tue, Jul 08, 2014 at 10:14:43PM +0200, Klaus Darilion wrote:
> The next question is, how to tell named that the zone has a new config. 
> I reused the addzone code. addzone calls configure_zone(). The comment 
> above configure_zone() says:
>    "* Configure or reconfigure a zone."
> 
> Thus I thought I could just call this function and it will update the 
> zone inside named, but I failed. The function exits with:
> 
>   named[22880]: none:1: zone 'test.at' already exists
>
> Thus, can I reuse this function to update the zone? Actually is it 
> possible to update the zone or do I have to delete and re-add it? How 
> does "rndc reconfig" update the zone?

configure_zone(), as currently written, is called by configure_view(),
which creates a brand new view and populates it with zones.  When you're
configuring for the first time, the zone objects are created; when you're
doing a reconfig, they're copied over from the pre-existing view and
reconfigured.  Either way, though, the view starts out empty, and finding
that a zone was already there would mean that you'd specified the same
zone more than once in named.conf.

You're changing the assumptions now, so you'll need to be able to
selectively disable that test.  (In fact, you need to reverse the sense of
it: if you're editing zone configuration, the zone *must* exist.) I would
suggest adding a new boolean parameter to configure_zone(), setting it to
true when the zone is being edited within a running view, and false
otherwise.

-- 
Evan Hunt -- each at isc.org
Internet Systems Consortium, Inc.


More information about the bind-workers mailing list