Perl and/or DB interface into nsd3

Hi All,

Be really grateful if anyone has luck with a Perl/DB interface into the nsd3 zone files.

I was looking at DNS::Config::File::Nsd but got an error when trying to $nsdfile->parse() undefined call to ‘read’, I’m guessing this is because the package is no longer maintained.

I’m trying a simple file:

-----nsdread.pl------
use DNS::Config::File::Nsd;

$file = “zonefile.conf”;

my $file = new DNS::Config::File::Nsd($file);

$file->parse();

-------end-------------

Can’t locate object method “read” via package “DNS::Config::File::Nsd” at /usr/local/share/perl/5.12.3/DNS/Config/File/Nsd.pm line 207.

Nsd.pm has this on line 207:

202: sub parse {
203: my($self, $file) = @_;
204:
205: $file = $file || $self->{‘FILE’};
206:
207: my @lines = $self->read($file); # error here with $self->read

----chop—

Can anyone shed any light on this or is this a stupid user error I’m having trying to get this working?

Thanks,

David

Hi All,

Be really grateful if anyone has luck with a Perl/DB interface into the nsd3 zone files.

I was looking at DNS::Config::File::Nsd but got an error when trying to $nsdfile->parse() undefined call to ‘read’, I’m guessing this is because the package is no longer maintained.

I’m trying a simple file:

-----nsdread.pl------
use DNS::Config::File::Nsd;

$file = “zonefile.conf”;

my $file = new DNS::Config::File::Nsd($file);

$file->parse();

-------end-------------

Can’t locate object method “read” via package “DNS::Config::File::Nsd” at /usr/local/share/perl/5.12.3/DNS/Config/File/Nsd.pm line 207.

Nsd.pm has this on line 207:

202: sub parse {
203: my($self, $file) = @_;
204:
205: $file = $file || $self->{‘FILE’};
206:
207: my @lines = $self->read($file); # error here with $self->read

----chop—

Can anyone shed any light on this or is this a stupid user error I’m having trying to get this working?

Thanks,

David

Just a wild guess:
  The documentation[1] says:
  # Read in an additional config file (needed before invoking
  # ->parse() ) $file->nsdc( $nsdc.conf_file );

[1] http://search.cpan.org/~wolf/DNS-Config-0.66/lib/DNS/Config/File/Nsd.pm

I was looking at DNS::Config::File::Nsd but got an error when trying to
$nsdfile->parse() undefined call to ‘read’, I’m guessing this is because the
package is no longer maintained.

I’m trying a simple file:

-----nsdread.pl------
use DNS::Config::File::Nsd;

$file = “zonefile.conf”;

my $file = new DNS::Config::File::Nsd($file);

$file->parse();

-------end-------------

Can’t locate object method “read” via package “DNS::Config::File::Nsd” at
/usr/local/share/perl/5.12.3/DNS/Config/File/Nsd.pm line 207.

Just a wild guess:
The documentation[1] says:

Read in an additional config file (needed before invoking

->parse() ) $file->nsdc( $nsdc.conf_file );

[1] http://search.cpan.org/~wolf/DNS-Config-0.66/lib/DNS/Config/File/Nsd.pm

So I’ve modified it as follows:

use DNS::Config::File::Nsd;

$file = “zonefile.zone”;

open (TEST, $file) or die $!;

my $read = new DNS::Config::File::Nsd($file);

$read->nsdc($file);

$read->parse();

And it still says:

Can’t locate object method “read” via package “DNS::Config::File::Nsd” at /usr/local/share/perl/5.12.3/DNS/Config/File/Nsd.pm line 207.

It is weird that I’m pretty sure the read method does not appear to be a native perl method and also does not appear in Nsd.pm.

Thanks,

David

I was looking at DNS::Config::File::Nsd but got an error when trying to
$nsdfile->parse() undefined call to ‘read’, I’m guessing this is because the
package is no longer maintained.

I’m trying a simple file:

-----nsdread.pl------
use DNS::Config::File::Nsd;

$file = “zonefile.conf”;

my $file = new DNS::Config::File::Nsd($file);

$file->parse();

-------end-------------

Can’t locate object method “read” via package “DNS::Config::File::Nsd” at
/usr/local/share/perl/5.12.3/DNS/Config/File/Nsd.pm line 207.

Just a wild guess:
The documentation[1] says:

Read in an additional config file (needed before invoking

->parse() ) $file->nsdc( $nsdc.conf_file );

[1] http://search.cpan.org/~wolf/DNS-Config-0.66/lib/DNS/Config/File/Nsd.pm

Ok, actually, just found this in DNS::Config::File

sub read {
my($self, $file) = @_;
my @lines;

$file = $file || $self->{‘FILE’};

if(open(FILE, $file)) {
@lines = ;
chomp @lines;
close FILE;
}
else { warn “File $file not found !\n”; }

return @lines;
}

It could be that ->nsdc doesn't expect a zonefile but your nsd.conf:
  $file->nsdc( $nsdc.conf_file )