in reply to Net::DNS, recursive queries & root nameservers

I did a few tests, and it looks like ->query is failing bacause there's nothing in the ANSWER section. Try changing the line that reads
my $res_packet = $res->query("www.slashdot.org");
with
my $res_packet = $res->send("www.slashdot.org");
Then you will be able to access the response packets and decide if you got a delegation or an answer.

Regards.

Replies are listed 'Best First'.
Re: Re: Net::DNS, recursive queries & root nameservers
by JPaul (Hermit) on Jan 05, 2002 at 03:25 UTC
    My greatest thanks.
    I reread over the Net::DNS manpage, and sure enough under search() and query() it says:
    "Returns a ... 'undef' if no answers were found".

    I read this to mean if the server was unable to respond (server answer) rather than in the ANSWER section.
    Either its not very clear, or I'm not not very sharp.

    Many thanks,
    JP

    -- Alexander Widdlemouse undid his bellybutton and his bum dropped off --