factor addresses out of 'forwarders' statement

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

factor addresses out of 'forwarders' statement

John Thurston
I have a number of 'forward' zones defined. Many of them look exactly
the same except for their name. It would be helpful to abstract the
addresses of my forwarders out and name them only once. But I can't find
any way to do this.

An ACL doesn't make sense. A 'masters' list doesn't work.

Is there some way to do this?

alias { 10.10.1.2; 10.10.3.4; 10.10.5.6; }
zone "foo" {type forward; forwarders ( alias;}; };



--
    Do things because you should, not just because you can.

John Thurston    907-465-8591
[hidden email]
Department of Administration
State of Alaska
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users
Reply | Threaded
Open this post in threaded view
|

Re: factor addresses out of 'forwarders' statement

Bind-Users forum mailing list
On 7/18/19 3:24 PM, John Thurston wrote:

> I have a number of 'forward' zones defined. Many of them look exactly
> the same except for their name. It would be helpful to abstract the
> addresses of my forwarders out and name them only once. But I can't find
> any way to do this.
>
> An ACL doesn't make sense. A 'masters' list doesn't work.
>
> Is there some way to do this?
>
> alias { 10.10.1.2; 10.10.3.4; 10.10.5.6; }
> zone "foo" {type forward; forwarders ( alias;}; };
Maybe.

Take a look at include statements.

You'll probably need to have the contents of the alias in it's own file:

--8<--
10.10.1.2; 10.10.3.4; 10.10.5.6;
-->8--

Then construct your zone statement a little bit differently.

--8<--
zone "foo" {type forward; forwarders (
include "/path/to/alias/file"
); };
-->8--

You are functionally doing what you want.

What you're really doing is manipulating text files that happen to be
the aggregate BIND config file.

You could probably move more of the duplicate part of the config into
the included file and have less to type for each zone.

Note:  I've not tested this in a while, things may have changed since I
last tried this.

The other non-BIND option is to use some sort of pre-processor to
generate your BIND config file for you.  I personally reach for M4 for
things like this.  I can define a macro that accepts the zone name as a
parameter.  Then I use the macro for each zone and let M4 stamp out the
necessary config lines for me.  }:-)

Then there are the other zone loading methods, DLZ, catalog zones, etc.



--
Grant. . . .
unix || die


_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: factor addresses out of 'forwarders' statement

Matus UHLAR - fantomas
In reply to this post by John Thurston
On 18.07.19 13:24, John Thurston wrote:

>I have a number of 'forward' zones defined. Many of them look exactly
>the same except for their name. It would be helpful to abstract the
>addresses of my forwarders out and name them only once. But I can't
>find any way to do this.
>
>An ACL doesn't make sense. A 'masters' list doesn't work.
>
>Is there some way to do this?
>
>alias { 10.10.1.2; 10.10.3.4; 10.10.5.6; }

>zone "foo" {type forward; forwarders ( alias;}; };

do you really need to use "type forward" zone?
that's needed when the zone contains subzones you do not know or their
nameservers are unreachable.

If not, you can try using stub or static-stub zone and named masters list.

yes, this is case where it would be greas to use masters for forward zones.

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Eagles may soar, but weasels don't get sucked into jet engines.
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/bind-users