BIND - Declare variable?

Chris Buxton chris.p.buxton at gmail.com
Fri Nov 5 06:15:33 UTC 2010


No. You can set a path in named.conf with the options { directory ...; }; statement, but that single path applies to all unqualified paths in named.conf.

You could, however, write this:

options {
	directory "/var/named";
};

logging {
	channel config_log {
		file "log/config" [...];
	};
	channel database_log {
		file "log/database" [...];
	};
};

Your directory structure might include a symlink at /var/named/log pointing to /var/log/dns.

Regards,
Chris Buxton
BlueCat Networks

On Nov 3, 2010, at 11:13 AM, Mike Cavanagh wrote:

> I do not think this is possible, but would like to confirm.
> I would like to declar a variable, and then use that variable elsewhere within the named.conf file.
>  
> I have multiple “channel” definitions with “file” options.  I want a variable for the path so I can change it once and update all entries:
> Example:
> channel config_log {
> file "/var/log/dns/config"
> versions 7
> size 20m
> ;
> channel config_log {
> file "/var/log/dns/config"
> versions 7
> size 20m
> ;
>  
> I would like:
> FQPN=/var/log/dns
>                 channel config_log (
>                                 File “$FQPN/config”
>                                                 Version 7
>                                                 Size 20m
>                                 ;
> channel database_log {
> file “$FQPN/database"
> versions 7
> size 20m
> ;
>  
> Obviously, I could take it even further with the version and size parameters.  It would be great to reduce this down to:
>                 FQPN=/var/log/dns
>                 Ch_Opts=Version 7 Size 20m
>  
>                 channel config_log (
>                                 File “$FQPN/config” $Ch_Opts ;
> channel database_log {
> file “$FQPN/database" $Ch_Opts ;
>  
> Thanks,
> Mike C
>  
> _______________________________________________
> bind-users mailing list
> bind-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20101104/e2e78442/attachment.html>


More information about the bind-users mailing list