there is a perl module out there that may help: http://cpan.uwinnipeg.ca/htdocs/BIND-Config-Parser/BIND/Config/Parser.html
I don't know - I'm not much of a perl monkey (or any of one, really), but I may work for what you'd like. t. -----Original Message----- From: bind-users-bounces+tsnyder=rim....@lists.isc.org [mailto:bind-users-bounces+tsnyder=rim....@lists.isc.org] On Behalf Of Stefan Certic Sent: Tuesday, June 28, 2011 4:55 PM To: bind-users@lists.isc.org; d...@maplepark.com Subject: Re: Named.conf logical blocks 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. Regards, On Tuesday, June 28, 2011 09:46:29 pm David Forrest wrote: > On 06/28/2011 05:53 PM, Stefan Certic wrote: > > Hi Guys, > > > > Does anyone have a sample grammar for pharsing named.conf into a data > > structure? Perl or PHP are preffered, but anything would be fine just to > > get a > > clear picture about grammar and logical blocks. > > I send mine through named-checkconf to put it in a consistent state. > This helps to reduce the includes and sort out the views and > blocks logically. > > See man named-checkconf. > > /usr/local/sbin/named-checkconf -p >/var/named/named.conf.canonical ||\ > echo -e "\nConversion failed, as will named if attempted" \ > &>>/var/named/named.conf.canonical -- Stefan Certic RoutoMessaging 48 Charlotte Street London, W1T 2NS United Kingdom http://www.routomessaging.com GSMA Associate Member Switchboard +44 (0) 870 231 7777 Fax + 44 (0) 870 231 7775 Email : ste...@routotelecom.com MSN ID : ste...@routotelecom.com DISCLAIMER This email contains information provided by Routo Telecommunications Ltd, which may be privileged or confidential. It is meant only for the individual(s) or entity named above. If you are not the intended recipient, note that disclosing, copying, distributing or using this information is prohibited. If you have received this email in error, please let me know immediately on the email address above. Routo Telecommunications Ltd may not be held responsible for the content of this email as it may reflect the personal view of the sender and not that of the company. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. We monitor our email system and may record your emails. Routo Telecommunications Ltd Registration Number 04546322 has its principal place of business at 48 Charlotte Street, London, W1T 2NS, United Kingdom. _______________________________________________ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful. _______________________________________________ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users