Named.conf logical blocks

Phil Mayers p.mayers at imperial.ac.uk
Wed Jun 29 07:21:46 UTC 2011


On 06/28/2011 09:54 PM, Stefan Certic wrote:
> I am more looking for a solution to read data with perl and convert to some
> native data structure, like hash reference, or multidimenzional array, so i
> can access and change data in form of: $named_conf_file->{view1}-{zoneblah} =
> 'somedata' and then dump it back into original format.

Ok, that didn't really come across in your email.

http://augeas.net/

...does what you want. It has a "lense" (their term for a config file 
description) for ISC dhcpd, which is a very similar syntax. It should be 
relatively trivial to turn out a lense for ISC bind.

Or use Config::Parser, or adapt the script I sent round (which in fact 
was the reason I wrote it); tokenisation of the bind config file is 
easy, and the core grammar is straightforward because everything is 
;-terminated, with the form:

item = thing+ block semicolon
thing = word | quoted-string
block = { item+ }



More information about the bind-users mailing list