[nsd-users] Perl and/or DB interface into nsd3

David H untg99 at gmail.com
Thu Jun 9 00:11:20 CEST 2011


On Thu, Jun 9, 2011 at 12:44 AM, Oliver Peter <lists at peter.de.com> wrote:

> On Wed, Jun 08, 2011 at 04:32:42PM +0930, David H wrote:
> > ...
> > 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 = <FILE>;
                chomp @lines;
                close FILE;
        }
        else { warn "File $file not found !\n"; }

        return @lines;
}



> --
> Oliver PETER       oliver at opdns.de       0x456D688F
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://open.nlnetlabs.nl/pipermail/nsd-users/attachments/20110609/34524398/attachment.html>


More information about the nsd-users mailing list