Re: TinyDNS data -> BIND zones?

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 ...


Go Back   Usenet Forums > DNS and Related Forums > Bind Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-04-2005
David Botham
 
Posts: n/a
Default Re: TinyDNS data -> BIND zones?

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




Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:30 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0