Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
more useful options
 
PerlMonks  

Re: using Net::DNS::Async

by Riales (Hermit)
on Feb 28, 2012 at 21:33 UTC ( #956774=note: print w/ replies, xml ) Need Help??


in reply to using Net::DNS::Async

I've never used this module before, but I dug briefly through the source and it looks like you can specify nameservers by passing it in within a hash in the add method. The documentation says to pass it a callback there, but if you give it a hashref instead, it will set nameservers according to whatever you specify.

Maybe something like this:

my $res = new Net::DNS::Async(..); $res->add( { Nameserver => [$server1], Callback => \&callback, }, @params );


Comment on Re: using Net::DNS::Async
Select or Download Code
Re^2: using Net::DNS::Async
by goose722 (Initiate) on Feb 29, 2012 at 18:13 UTC
    Can I ask for the link to the documentation you were looking at? Thanks a lot, by the way.

      Sure: Net::DNS::Async

      Also, here's the relevant code snippet from the module:

      sub add { my ($self, $params, @query) = @_; my ($callback, @ns); if (ref($params) eq 'HASH') { @query = @{ $params->{Query} } if exists $params->{Query}; $callback = $params->{Callback}; @ns = @{ $params->{Nameservers} } if exists $params->{Nameserv +ers}; } else { $callback = $params; } (...) }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://956774]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-04-23 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (556 votes), past polls