Score:0

BIND - named.conf.local and define variables/functions?

br flag
sec

I'm using Ubuntu 20.04 and BIND 9.16.1. In named.conf.local i'm using three zones

zone "lan" in {

        type slave;

        file "/var/cache/bind/db.lan";

        masters { 192.168.0.7 };

};

zone "local2" in {

        type slave;

        file "/var/cache/bind/db.local2";

        masters { 192.168.0.7 };

        masterfile-format text;

};

zone "p2p" in {

        type slave;

        file "/var/cache/bind/db.p2p";

        masters { 192.168.0.7 };

        masterfile-format text;

};

But when I would like to change location for file save or masters IP, I need to do it separately per zone. Of course I know that I can use vim and substitution, but still. Is there any way to do it using variable or function or something like that? For example Like:

masterDNS="192.168.0.7"

    zone "p2p" in {
    
            type slave;
    
            file "/var/cache/bind/db.p2p";
    
            masters { masterDNS; };
    
            masterfile-format text;
    
    };

Thanks

Score:0
cn flag

You can use something like this:

masters masters-ips { 192.168.0.7; };

zone "p2p" in {
            type slave; 
            file "/var/cache/bind/db.p2p";
            masters { masters-ips; };
            masterfile-format text;
    };

See additional examples

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.