in-view duplicate zone not detected by named-checkconf
It doesn't seem that the configuration checker is applied effectively to zones of type 'in-view' that are declared referencing a copy of the zone that is being loaded in another view.
For example:
view "my-default" {
...
zone "yum.co.uk" IN {
type master;
file "yum.co.uk.zone";
};
...
};
view "another-one" {
match-clients { any; };
zone "yum.co.uk" IN {
type master;
file "yum.co.uk.zone";
};
zone "yum.co.uk" IN {
in-view "my-default";
};
};
There are no errors reported when it is run through named-checkconf, but when loading, named fails when parsing the second instance of "yum.co.uk" in the second view - having not previously detected that there might be a problem loading it.
The error message reported is not particularly helpful:
02-Mar-2018 18:37:43.266 automatic empty zone: view my-default: EMPTY.AS112.ARPA
02-Mar-2018 18:37:43.266 loading configuration: already exists
02-Mar-2018 18:37:43.266 exiting (due to fatal error)
Compare this with the scenario where the same zone has been declared identically in the view:
...
view "another-one" {
match-clients { any; };
zone "yum.co.uk" IN {
type master;
file "yum.co.uk.zone";
};
zone "yum.co.uk" IN {
type master;
file "yum.co.uk.zone";
};
$ named-checkconf /etc/named.conf
/etc/named.conf:180: zone 'yum.co.uk': already exists previous definition: /etc/named.conf:175
$
Which of course is repeated if you try to start named without checking the configuration first:
02-Mar-2018 18:51:24.689 loading configuration from '/etc/named.conf'
02-Mar-2018 18:51:24.690 /etc/named.conf:180: zone 'yum.co.uk': already exists previous definition: /etc/named.conf:175
02-Mar-2018 18:51:24.690 loading configuration: failure
02-Mar-2018 18:51:24.690 exiting (due to fatal error)
It would be helpful if the in-view zones were included in the same sanity checking as other zone types, and thus generate a more helpful error message (including the line number of named.conf) for the administrator to fix.