This is a discussion on Re: TinyDNS data -> BIND zones? within the Bind Users forums, part of the DNS and Related Forums category; bind-users-bounce@isc.org wrote on 05/04/2005 05:38:31 AM: > I am running a mixed ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
bind-users-bounce@isc.org wrote on 05/04/2005 05:38:31 AM:
> I am running a mixed BIND / TinyDNS environment (inherited) and am > trying to find a script to convert the TinyDNS data format into > BIND zone files. Does such a thing exist? Sorry, no gots, but, below is a script that you might be able to use as the bottom half of a script that generates the BIND zone statements. You will have to write the top half that sucks in the tdns stuff... #!/usr/bin/perl #Get the IP of the Master for these zones... # David Botham print "Enter a description for this segment: "; $discription = <STDIN>; chomp $discription; print "Enter the IP address of the Master name server for these zones: "; $MASTER = <STDIN>; chomp $MASTER; print "Enter the sub-directory for these zones: "; $DIRECTORY = <STDIN>; chomp $DIRECTORY; #Open the file containing the zone names, one per line... print "Enter the name of the file containing zone list: "; $DLIST = <STDIN>; chomp $DLIST; open(INFILE, "$DLIST"); print "Enter the name of the Zone DB File: "; $ZONEDB = <STDIN>; chomp $ZONEDB; #Open the output files, one for the Master named.conf and one for the Slave named.conf open(SLAVE, ">$DLIST.slave.txt"); open(MASTER, ">$DLIST.master.txt"); print MASTER "//\n// $discription\n//\n"; print SLAVE "//\n// $discription\n//\n"; #Read the list of domains from the file containing the zone names... @DOMAINS = (<INFILE>); #Write the zone directives to the conf files... foreach $DOMAIN (@DOMAINS) { chomp $DOMAIN; print MASTER "zone \"$DOMAIN\"\{\n\ttype master\;\n\tfile \"$DIRECTORY\/$ZONEDB\"\;\n\t\n\}\;\n"; print SLAVE "zone \"$DOMAIN\"\{\n\ttype slave\;\n\tfile \"$DIRECTORY\/$DOMAIN.$ZONEDB\"\;\n\tmasters\{$MASTER\;\}\;\n\}\ ;\n"; } #Close all files, write an error message if not sucessful... close INFILE || die "could not close file $!"; close MASTER || die "could not close file $!"; close SLAVE || die "could not close file $!"; You may have to copy it to a text editor and fix any line wrapping that may have occurred in transit... hth, Dave... > > I am aware that I could simply perform a zone transfer from the > TinyDNS server but a script would be simpler to integrate into my > setup. > > Many thanks, > > > Pete. > -- > Pete Philips > Datasouth UK Ltd > Email: pete@datasouth.co.uk > PGP: http://www.datasouth.co.uk/pgp/pete.gpg > > |