Hello,
I am seeking help with someone with perl expertise that can create me a script that will read a named.conf file and create a csv or a text file on each of the zones that the named.conf contains. An excerpt of named.conf looks like:
acl "our_nets" {
127.0.0.1/32;
};
options {
directory "D:\\named\idns\";
check-names master ignore;
check-names slave ignore;
version "[Unknown]";
allow-query { any; };
allow-recursion { our_nets; };
};
zone "." {
type hint;
file "db-metro/db.cache";
};
zone "0.IN-ADDR.ARPA" {
type master;
file "db-metro/db.0.0.0.0";
};
zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "db-metro/db.127.0.0.0";
};
zone "224.162.207.IN-ADDR.ARPA" {
type master;
file "db-metro/db.207.162.224.0";
};
And example of a db.X file from above ("db-metro/db.0.0.0.0"
$TTL 3600
0.IN-ADDR.ARPA. IN SOA pwedns1.internet.com. hostmaster.internet.com. (
2008121203 ; Serial
900 ; Refresh
300 ; Retry
1209600 ; Expire
3600 ) ; Minimum
0.IN-ADDR.ARPA. IN NS pwedns1.internet.com.
0.IN-ADDR.ARPA. IN NS pmedns1.internet.com.
0.IN-ADDR.ARPA. IN NS phedns1.internet.com.
So, what I wish to happen is get a perl script that will read the above named.conf file and look at each db.x file and spit out the contents of that zone into a separate file for each zone. I dont need the email, serial/refresh, retry, expire, or minimum values but the the server name in the SOA and the rest of the contents into A text file or csv would be awesome !
I would like for this script to be used either on windows or Unix since my test systems are both, but windows is easier since I have one of these at home that I can test the script with
Thanks, and I hope to hear from you all soon !