Sponsored Content
Top Forums Shell Programming and Scripting seeking help with perl to read named.conf Post 302292506 by richsark on Saturday 28th of February 2009 09:42:30 AM
Old 02-28-2009
seeking help with perl to read named.conf

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"Smilie


$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 Smilie

Thanks, and I hope to hear from you all soon !

Last edited by richsark; 02-28-2009 at 10:43 AM.. Reason: spelling
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

can't find named.conf to configuration DNS

Help me! I have problem. I can't find named.conf file in /etc (Solaris 5.6,SPRAC) Please! (1 Reply)
Discussion started by: nghia77
1 Replies

2. Shell Programming and Scripting

Parse "masters" ip from named.conf

Hi there, Im' trying to make a script to parse the BIND configuration file from my slave DNS server and obtain a certain parameter. The named.conf file has this format: zone "0.170.20.10.in-addr.arpa" { type slave; file "0/./db.0.170.20.10.in-addr.arpa.bak"; allow-notify {... (2 Replies)
Discussion started by: Citricut
2 Replies

3. Shell Programming and Scripting

perl read and write to conf file

Hi Everyone, There is a perl file: a.pl ============ #!/usr/bin/perl my $config_file = $ARGV; open CONFIG, "$config_file" or die "Program stopping, couldn't open the configuration file '$config_file'.\n"; my $config = join "", <CONFIG>; close CONFIG; eval $config; die "Couldn't... (1 Reply)
Discussion started by: jimmy_y
1 Replies

4. Shell Programming and Scripting

Finding missing files that are named sequentially with Perl?

Hello I am new to Perl, in fact I am on chapter one of the book. :) However I am in need of a Perl Script faster than I can finish the book. Perhaps someone can help me with my immediate need while I read my book. I have a directory with hundreds of files that are all named like... (4 Replies)
Discussion started by: newftronics
4 Replies

5. UNIX for Dummies Questions & Answers

How to configure smb.conf for read and copy access only

Hi there, I want to give access with samba to a folder but with read and copy rights but no write. I don't want somebody to be able to delete the files. I found the read only parameter but this doesn't allow the users to copy the files. Is there an option for this? The configuration looks... (2 Replies)
Discussion started by: sickboy
2 Replies

6. Solaris

BIND 9 ---> no /etc/named.conf file after installation

Hi I installed BIND 9 from dvd image of my Solaris 10 (SUNWbind, SUNWbindr) and when I try to start it(svcadm enable network/dns/server), it says there is no /etc/named.conf file. Why is it so ? Should not this file be created during installation phase ? Do I have to create it manually ?... (0 Replies)
Discussion started by: presul
0 Replies

7. Homework & Coursework Questions

C Program to search and read all named pipes in current directory

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a C program to search the current directory for all pipes. 1. It will print the pipe... (2 Replies)
Discussion started by: natwickley
2 Replies

8. Red Hat

Named.conf file missing Centos 5.

hello everyone, I have install centos 5 recently.The file /etc/named.conf not found. I have installed BIND using yum. so now what to do ?? should i create named.conf file manually ??? please help me. thanks, sharlin. :) (1 Reply)
Discussion started by: sharlin
1 Replies

9. Shell Programming and Scripting

perl Compare zone files in directory with what is listed in named.conf

I would really appreciate any assistance that I can get here. I am fairly new to perl. I am trying to rewrite my shell scripts to perl. Currently I have a shell script (using sed, awk, grep, etc) that gets a list of all of the zone files in a directory and then looks in named.conf for what... (0 Replies)
Discussion started by: brianjb
0 Replies

10. Shell Programming and Scripting

UNIX fifo concurrent read from a named pipe

I have created a fifo named pipe in solaris, which writes the content of a file, line by line, into pipe as below: $ mkfifo namepipe $ cat books.txt "how to write unix code" "how to write oracle code" $ cat books.txt >> namepipe & I have a readpipe.sh script which reads the named... (2 Replies)
Discussion started by: naveen mani
2 Replies
zcons(7D)							      Devices								 zcons(7D)

NAME
zcons - Zone console device driver DESCRIPTION
The zcons character driver exports the console for system zones. The driver is comprised of two "sides:" a master side with which applica- tions in the global zone communicate, and a slave side, which receives I/O from the master side. The slave side is available in the global zones. Applications must not depend on the location of /dev or /devices entries exported by zcons. Inside a zone, the zcons slave side is fronted by /dev/console and other console-related symbolic links, which are used by applications that expect to write to the system console. The zcons driver is Sun Private, and may change in future releases. FILES
/dev/zcons/<zonename>/masterconsole Global zone master side console for zone <zonename>. /dev/zcons/<zonename>/slaveconsole Global zone slave side console for zone <zonename>. /dev/zconsole Non-global zone console (slave side). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ | Interface Stability |Sun Private | +-----------------------------+-----------------------------+ SEE ALSO
zoneadm(1M), zonecfg(1M), attributes(5), zones(5) SunOS 5.10 24 Aug 2003 zcons(7D)
All times are GMT -4. The time now is 11:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy