markcastle
03-02-2001, 06:58 AM
Hi All,
Does anyone know where i can get hold of some scripts to parse DNS files?
Basically, i need to parse the contents of thousands of DNS files in order to put them into a database and i really don't want to do it manually.
Hope someone can help.
Thanks in advance
Mark
elijah_jr
03-02-2001, 12:46 PM
Im looking for one too...
nopzor
03-04-2001, 04:44 AM
I'd be happy to help anyone who needs this.
Email me off the list and I'll give you what we have.
It simply goes through each zone file, gets the IP for the www IN record and correlates the two.
DHWWnet
03-04-2001, 05:26 PM
i'll send an email right away :) thamks
elijaH
markcastle
03-07-2001, 08:37 AM
Hi All,
Many thanks for the replies (especially Raj - i'll be contacting you).
After i had posted this message, we went away and wrote a perl module to parse zone files and produce XML (or any other) output. We'll be posting this on CPAN soon, but if anyone would like a copy, please let me know.
Thanks - Mark Castle
Toons
03-07-2001, 10:41 AM
I would also like a look if possible, Im currently trying to import 3500 zone files into a mysql database and its a little awkward.
(E-Mail is tony@xcalibre.co.uk)
Regards,
Tony Lucas
I needed to import a large amount of zones into a SQL database too - last year. So I wrote some Perl code to do it -- no problem. But later I found the _correct_ solution (which I am now using).
It's both easier, fast and more correct than using Perl :-)
Simply try downloading the bind sources, and you will find there's a set of support functions for reading in and parsing zone files - returning them as a set of RR records in a node (easy to program with).
With the new Bind9 there's even an example program that imports zone files into a PostgreSQL database. It was very easy to edit that into importing in a MySQL database.
--
Jens Kristian Søgaard, Mermaid Consulting I/S,
jens@mermaidconsulting.dk,
http://www.mermaidconsulting.com/
markcastle
04-17-2001, 07:14 AM
Hi Jens,
Many thanks for the TIP.
You may be interested to know that we went away and wrote a Perl module that parses Zone Files also; It is available to download from CPAN. My colleague Simon Flack took the bare bones of what we needed and wrapped it up as a rather useful utility.
http://search.cpan.org/search?dist=DNS-ZoneParse
It also produces XML output.
Best Regards
Mark Castle