Hi douzzer,
As Dick mentions this is the correct behaviour, and send should be used
if you wish to inspect the other packet data.
Regards, Willem
On Wed Apr 14 14:19:26 2010, rwfranks@acm.org wrote:
Show quoted text> On Wed Apr 14 04:51:05 2010, douzzer wrote:
> > Net::DNS::Resolver::Base::query() fails (returns undef) if there are
> no RR's in the answer section.
>
>
> This is expected and well-documented behaviour, NOT a bug.
> Run perldoc Net::DNS::Resolver to see the following explanation and
advice.
Show quoted text>
> --Dick
>
>
> query
>
> $packet = $res->query('mailhost');
> $packet = $res->query('mailhost.example.com');
> $packet = $res->query('192.168.1.1');
> $packet = $res->query('example.com', 'MX');
> $packet = $res->query('user.passwd.example.com', 'TXT', 'HS');
>
> Performs a DNS query for the given name; the search list is not
> applied. If the name doesn’t contain any dots and
> defnames is true then the default domain will be appended.
>
> The record type and class can be omitted; they default to A and IN.
> If the name looks like an IP address (IPv4 or
> IPv6), then an appropriate PTR query will be performed.
>
> Returns a "Net::DNS::Packet" object, or "undef" if no answers were
> found. If you need to examine the response packet
> whether it contains any answers or not, use the send() method instead.
>
>
> send
>
> $packet = $res->send($packet_object);
> $packet = $res->send('mailhost.example.com');
> $packet = $res->send('example.com', 'MX');
> $packet = $res->send('user.passwd.example.com', 'TXT', 'HS');
>
> Performs a DNS query for the given name. Neither the searchlist nor
> the default domain will be appended.
>
>