Chad_MacArthur has asked for the wisdom of the Perl Monks concerning the following question:

G'DAy mate

I run my program that uses the perl module Net:DNS

And recieve the error message

!!! WARNING The program has attempted to call the method "address" for the following RR object:
life.csu.edu.au. 86400 IN CNAME lorenz.mur.csu.edu.au
This method does not have an method "address" this is a BUG in the calling software,
which has inccorectly assumed that the object would be of an particular type.
The calling software should check the type of each RR object before calling any of it's methods.
Net:DNS has returned an undef to the caller.

This is part of my program that does a DNS lookup on inputed addresses then pings the address

# DNS LOOKUP ! $packet = $res->query($hostname); if (!$packet) { warn "Unable to lookup data for host from server"; } foreach $rr ($packet->answer) ##THE ERROR OCCURS HERE!!! { $result{$server}=$rr->address; } Data::Dumper->Dump([\%result],["result"]);
THANKS HELP FOR ANY HELP

Chad

20040526 Edit by Corion: Moved code into code tags

  • Comment on Warning message in Perl Net:DNS perl module address in DNS lookup!!
  • Download Code

Replies are listed 'Best First'.
Re: Warning message in Perl Net:DNS perl module address in DNS lookup!!
by jepri (Parson) on May 26, 2004 at 09:44 UTC
    You are doing the wrong kind of query. Instead of calling "$res->query($hostname);", you have to call "$res->search($hostname);"

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.