Common zone file, on multiple views

Grant Taylor gtaylor at tnetconsulting.net
Tue Nov 13 18:02:42 UTC 2018


On 11/12/2018 04:57 AM, Sabri MJAHED (VINC) wrote:
> Hi all,

Hi,

> I want to have the same zone on multiple views, but i didn't find any 
> solution that ease the use of this.

I would think that the zone's "in-view" statement would do what you want.

> I don't want to make 3 file of zone conf with multiple in-view statements.

But it sounds like your problem is that you dislike the overhead of 
managing the multiple "in-view" statements.

> Here is the server-fault post with more information : 
> https://serverfault.com/questions/939287/bind-common-zone-on-views-possibilities 

I might be misunderstanding you, but it seems like the following might work:

named.conf
--8<--
view "common-zones" {
	zone "example.com" {…};
	zone "example.net" {…};
	zone "example.org" {…};
};

view "mordor" {
	include common-zones.conf;
	zone "mordor.example" {…};
}

view "gondor" {
	include common-zones.conf;
	zone "gondor.example" {…};
}

view "khand" {
	include common-zones.conf;
	zone "khand.example" {…};
}
-->8--

common-zones.conf
--8<--
zone "example.com" {
	in-view "common-zones";
};

zone "example.net" {
	in-view "common-zones";
};

zone "example.org" {
	in-view "common-zones";
};
-->8--

Note:  This is untested and conceptual.

The idea being that you define the zones in the "common-zones" view, and 
then in-view them in the common-zones.conf file.  That way any view that 
includes the common-zones.conf file will include all the in-view(ed) 
zone definitions.

Does this do what you want?

I think it keeps you from needing to modify all the zones that include 
common-zones.conf when you add a zone to the common zones.  Which I 
think is your goal.

> Thanks a lot.

Here's hoping this helps.  Good luck and you're welcome.



-- 
Grant. . . .
unix || die

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3982 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20181113/acce11d2/attachment.bin>


More information about the bind-users mailing list