rndc addzone for subnetted reverse zones

Charles Musser cmusser at sonic.net
Thu Apr 9 21:55:37 UTC 2015

We are trying to manage almost all zones served by a slave dynamically via
addzone and delzone, but are having trouble with subnetted reverse zones.
The problem is that adding the zone is successful (it's resolvable), but the
 entry written to the NZF file causes errors when the server is reloaded or
 restarted. An example:

1. Add the zone via rndc:

   /usr/sbin/rndc addzone \"160/\" '{ type slave; file "160-"; masters {; }; };'

   Note the escaped quotes, required to avoid an "unexpected token" error
   from rndc. At this point dig can resolve this zone. The NZF file contains
   this line:

   zone 160/ { type slave; file "160-"; masters {; }; };

2. Restart named via "rndc reload". This causes the following message to
   appear in the syslog:

   named[1275]: config: error: 3bf305731dd26307.nzf:71066: '{' expected near '/'

   At this ping, no zones specified in the NZF file are loaded according to
   "rndc status" and queries are refused.

3. Edit the NZF so that this zone's name is quoted, as shown below:

   zone "160/" { type slave; file "160-"; masters {; }; };

   Issuing an "rndc reload" now causes the server to load the zones and answer

It seems that quotes are required if the zone name contains a slash (and
possibly other characters) and whatever is in charge of writing that file is
not quoting the name when necessary. But maybe we're doing this the
wrong way.


More information about the bind-users mailing list