The Network People Support Forums

Other TNPI Software => NicTool => Topic started by: planohog on March 19, 2007, 03:47:34 PM

Title: export out of database into zone files for bind
Post by: planohog on March 19, 2007, 03:47:34 PM
Greetings,

did a search file,  I really need to export the database into zone files for safe keeping.

we will be moving to bind out of tinydns but keeping the gui for operations.

can anyone point me at a script or show me how I can get this

tinydns to bind conversion.. Used search found old things from 2004 unanswered

thanks in advance.

Title: Re: export out of database into zone files for bind
Post by: Ross on February 18, 2009, 10:22:27 PM
does nictool support BIND?
Title: Re: export out of database into zone files for bind
Post by: matt on February 18, 2009, 10:30:20 PM
NicTool doesn't support BIND very well. It should, and somebody hacked together some export scripts that are here on the forum.

For those that want to transfer data from NicTool to BIND, the easiest path is exporting to tinydns, and doing zone transfers from axfrdns (it comes with djbdns) to your BIND server.
Title: Re: export out of database into zone files for bind
Post by: Ross on February 19, 2009, 03:50:48 AM
yeah, djbdns does not do dnssec, which is a business requirement.
i am hoping for something that was like ProBIND2, but maybe commercially supported.
http://probind2.sourceforge.net/

by 'not very well' and 'someone hacked together some scripts', i am fair
old linux hack, and the mod-perl stuff is not daunting.

is it 'usable'?

We have 16 BIND servers spread across 5 DC's. I need something that can manage
them all.

We have some one at work, who is trying to sell everyone on powerdns, and I need
to find something that can, even with some tweaking, take the data and push it
to a BIND server. named.conf too if possible, to make it a total mgt thing.

Anyone know the limitations of these hacks?
I work for a company that should've had their own better way of doing things, but didn't,
and before someone sells management on a worse way (custom inhouse Ruby thing), I
wanted to find something out there people who use BIND use, since
BIND is *old* and so widespread, there had to be something better.
Title: Re: export out of database into zone files for bind
Post by: technicidat on July 14, 2009, 11:45:48 AM
Hi,

You might want to see a post I just added about a BIND export script.

Andy.
Title: Re: export out of database into zone files for bind
Post by: matt on November 13, 2011, 12:39:02 PM
Hey guys,

Good news. Another client needed some custom DNS exports so I wrote an export system for NicTool. It completely replaces the old exports. Now it is much, much easier to export to other DNS servers, including BIND. I'm available to write this now, if someone were interested in funding it.
Title: Re: export out of database into zone files for bind
Post by: jfdesir on May 04, 2012, 09:59:40 AM
Good job for this export script to BIND.

I discorvered somhting that make some specifics zones failed. In those specifics zones there's only NS RECORDs.
If you administer a root  dns zone this export tool cannot be use.

a root zone (like .zr)

The SOA

.zr  ttl in SOA soa_server.fqdn email(
                            serial
                            refresh
                            retry
                            expiry
                            minimum
)
.zr NS primary.
.zr NS secondary.

toto NS ns1_for_toto.
       NS ns2_for_toto.

#####

With the export script to BIND (nt_export.pl)

.zr  ttl in SOA soa_server.fqdn email(
                            serial
                            refresh
                            retry
                            expiry
                            minimum
)
.zr NS primary.
.zr NS secondary.

.toto NS ns1_for_toto.
.toto NS ns2_for_toto.

#####

Because of the beginig point "."  we change the  $ORIGIN.
So all the entries of that zone have seen as "out-of-zone  data".

Regards,
Title: Re: export out of database into zone files for bind
Post by: matt on May 04, 2012, 11:19:02 AM
I'm not following your example. Can you please create a sample zone in NicTool that demonstrates the problem? Then include the zone data that NicTool exported and a diff of the export and what the zone file needs to have to work properly?
Title: Re: export out of database into zone files for bind
Post by: jfdesir on May 04, 2012, 02:07:52 PM
The files are joined
Title: Re: export out of database into zone files for bind
Post by: matt on May 04, 2012, 02:20:59 PM
Ah, I think I see the problem. Try this:

--- a/server/lib/NicToolServer/Export/BIND.pm
+++ b/server/lib/NicToolServer/Export/BIND.pm
@@ -59,10 +59,14 @@ sub zr_txt {
}

sub zr_ns {
-    my ($self, $r) = @_;
+    my ($self, $r, $fully_qualified) = @_;

+    if ( $fully_qualified ) {
# name  ttl  class  type  type-specific-data
-    return "$r->{name}.        $r->{ttl}       NS      $r->{address}\n";
+        return "$r->{name}     $r->{ttl}       NS      $r->{address}\n";
+    };
+
+    return "$r->{name} $r->{ttl}       NS      $r->{address}\n";
}

sub zr_ptr {
diff --git a/server/lib/NicToolServer/Export/Base.pm b/server/lib/NicToolServer/Export/Base.pm
index 18488e7..1f97090 100644
--- a/server/lib/NicToolServer/Export/Base.pm
+++ b/server/lib/NicToolServer/Export/Base.pm
@@ -53,8 +53,8 @@ sub export_db {
         my $fh = $self->get_export_file( $z->{zone} );
         $self->{nte}{zone_name} = $z->{zone};

-        $fh->print($self->{nte}->zr_soa( $z ));
-        $fh->print($self->{nte}->zr_ns(  $z ));
+        $fh->print($self->{nte}->zr_soa( $z    ));
+        $fh->print($self->{nte}->zr_ns ( $z, 1 ));

         my $records = $self->get_records( $z->{nt_zone_id} );
         foreach my $r ( @$records ) {
Title: Re: export out of database into zone files for bind
Post by: jfdesir on May 04, 2012, 05:00:40 PM
Il will try this  and make you know

Thanks!
Title: Re: export out of database into zone files for bind
Post by: jfdesir on May 04, 2012, 05:46:41 PM
Those changes on BIND.pm remove the point '.' after the records but this introduce another issue.

On all zones now the no nameserver

because we have now:

mq.  IN SOA ...(
         .. ...
Title: Re: export out of database into zone files for bind
Post by: jfdesir on May 05, 2012, 08:19:17 PM
The  zones now have no nameserver on them  because there's no more point "." after  de FQND


consoto.com  IN NS ns1.fqdn.
consoto.com IN NS ns2.fqdn.

Bind translate this to consoto.com.consoto.com.

a good  zone description would be:

consoto.com.  IN NS ns1.fqdn.   
consoto.com. IN NS ns1.fqdn.

i put my nameserver in BIND.pm directly.
i'm working on a correction for that.


regards,