Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Net::Nslookup PTR lookup help

by kubrat (Scribe)
on Jan 28, 2009 at 13:50 UTC ( #739558=note: print w/replies, xml ) Need Help??

in reply to Net::Nslookup PTR lookup help

Try this:

my $name = nslookup(host => "", type => "PTR");

Uses 'host' for a key in the PTR query instead of 'domain'. I just copied the example provided in the module's documentation.

Update: It doesn't work for me either. This module is just a wrapper for Net::DNS. You can fix the problem by deleting an if statement in its _lookup_ptr function.

If you substitute the following ...

$query = $res->search($term, "PTR") || return; for $rr ($query->answer) { if ($rr->can('ptrdname')) { push @answers, $rr->ptrdname; } }

with ...

$query = $res->search($term, "PTR") || return; for $rr ($query->answer) { push @answers, $rr->ptrdname; }

then it works as expected :)

Replies are listed 'Best First'.
Re^2: Net::Nslookup PTR lookup help
by blackstealth (Novice) on Jan 28, 2009 at 13:53 UTC
    All to unfortunately it still doesn't work from reading the documentation it was my understanding that i could use "host", "domain", or "term" all interchangeably :( but still no luck.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://739558]
[dr_jkl]: dumb question, can i use __DATA__ and EOF POD at the same time?

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2017-10-18 20:10 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (250 votes). Check out past polls.