Variable in name of file for named.conf
Barry Margolin
barmar at alum.mit.edu
Thu Apr 2 02:09:23 UTC 2015
In article <mailman.1867.1427927445.26362.bind-users at lists.isc.org>,
Jeff Sadowski <jeff.sadowski at gmail.com> wrote:
> I have a number of slave domains that I would like a naming scheme and
> not have to go to each and change the filename.
>
> I have the following zones
>
> zone "1.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "2.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "3.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "4.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "5.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "6.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "7.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "8.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "9.168.192.in-addr.arpa" {
> include "named.slave";
> };
> zone "10.168.192.in-addr.arpa" {
> include "named.slave";
> };
>
> named.slave looks as follows
>
> type slave;
> masters {192.168.1.2;};
> file "data/db. at .slave";
>
> It appears to work on my queries.
>
> nslookup 192.168.1.2
>
> 2.1.168.192.in-addr.arpa name = pdc.<domain>
>
> nslookup 192.168.1.1
>
> 1.1.168.192.in-addr.arpa name = gw1.<domain>
>
> nslookup 192.168.2.1
>
> 1.2.168.192.in-addr.arpa name = gw2.<domain>
>
> the only file created in my data directory seems to be db. at .slave
> with the at sign.
Why would you expect anything different? @ only has special meaning
inside zone files, it's not special in named.conf.
>
> Do I really need to have each zone with its own file?
Yes, you do. What's happening is that every time one of the reverse
zones is transferred, it's overwriting that file. But the files are only
used when initializing the zones when named starts up; you get the
correct answers because the in-memory versions of the zones are
distinct. But try restarting named and then see what happens when you do
those nslookups. You'll see that 192.168.1.1 and 192.168.2.1 both return
the same name.
>
> Is there a special syntax to get what I expect?
> expected files:
> data/db.1.168.192.in-addr.arpa.slave
> data/db.2.168.192.in-addr.arpa.slave
> data/db.3.168.192.in-addr.arpa.slave
> ...
> data/db.10.168.192.in-addr.arpa.slave
>
> if not I can have Make do it and build some scripts to do what I want
> but if there is syntax to do what I want it would be nice.
No, there's no built-in syntax to create the filename based on the zone
name.
--
Barry Margolin
Arlington, MA
More information about the bind-users
mailing list