Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::dns::resolver::recurse(3) [osx man page]

Net::DNS::Resolver::Recurse(3)				User Contributed Perl Documentation			    Net::DNS::Resolver::Recurse(3)

Net::DNS::Resolver::Recurse - Perform recursive dns lookups SYNOPSIS
use Net::DNS::Resolver::Recurse; my $res = Net::DNS::Resolver::Recurse->new; DESCRIPTION
This module is a sub class of Net::DNS::Resolver. So the methods for Net::DNS::Resolver still work for this module as well. There are just a couple methods added: hints Initialize the hint servers. Recursive queries need a starting name server to work off of. This method takes a list of IP addresses to use as the starting servers. These name servers should be authoritative for the root (.) zone. $res->hints(@ips); If no hints are passed, the default nameserver is asked for the hints. Normally these IPs can be obtained from the following location: recursion_callback This method is takes a code reference, which is then invoked each time a packet is received during the recursive lookup. For example to emulate dig's "+trace" function: $res->recursion_callback(sub { my $packet = shift; $_->print for $packet->additional; printf(";; Received %d bytes from %s ", $packet->answersize, $packet->answerfrom ); }); query_dorecursion This method is much like the normal query() method except it disables the recurse flag in the packet and explicitly performs the recursion. $packet = $res->query_dorecursion( "", "A"); IPv6 transport If the appropriate IPv6 libraries are installed the recursive resolver will randomly choose between IPv6 and IPv4 addresses of the nameservers it encounters during recursion. If you want to force IPv4 transport use the force_v4() method. Also see the IPv6 transport notes in the Net::DNS::Resolver documentation. AUTHOR
Rob Brown, SEE ALSO
Net::DNS::Resolver, COPYRIGHT
Copyright (c) 2002, Rob Brown. All rights reserved. Portions Copyright (c) 2005, Olaf M Kolkman. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. $Id: 932 2011-10-26 12:40:48Z willem $ perl v5.16.2 2012-01-27 Net::DNS::Resolver::Recurse(3)

Check Out this Related Man Page

Mail::SpamAssassin::DnsResolver(3)			User Contributed Perl Documentation			Mail::SpamAssassin::DnsResolver(3)

Mail::SpamAssassin::DnsResolver - DNS resolution engine DESCRIPTION
This is a DNS resolution engine for SpamAssassin, implemented in order to reduce file descriptor usage by Net::DNS and avoid a response collision bug in that module. METHODS
$res->load_resolver() Load the "Net::DNS::Resolver" object. Returns 0 if Net::DNS cannot be used, 1 if it is available. $resolver = $res->get_resolver() Return the "Net::DNS::Resolver" object. $res->nameservers() Wrapper for Net::DNS::Resolver->nameservers to get or set list of nameservers $res->connect_sock() Re-connect to the first nameserver listed in "/etc/resolv.conf" or similar platform-dependent source, as provided by "Net::DNS". $res->get_sock() Return the "IO::Socket::INET" object used to communicate with the nameserver. $packet = new_dns_packet ($host, $type, $class) A wrapper for "Net::DNS::Packet::new()" which traps a die thrown by it. To use this, change calls to "Net::DNS::Resolver::bgsend" from: $res->bgsend($hostname, $type); to: $res->bgsend(Mail::SpamAssassin::DnsResolver::new_dns_packet($hostname, $type, $class)); $id = $res->bgsend($host, $type, $class, $cb) Quite similar to "Net::DNS::Resolver::bgsend", except that when a response packet eventually arrives, and "poll_responses" is called, the callback sub reference $cb will be called. Note that $type and $class may be "undef", in which case they will default to "A" and "IN", respectively. The callback sub will be called with three arguments -- the packet that was delivered, and an id string that fingerprints the query packet and the expected reply. The third argument is a timestamp (Unix time, floating point), captured at the time the packet was collected. It is expected that a closure callback be used, like so: my $id = $self->{resolver}->bgsend($host, $type, undef, sub { my ($reply, $reply_id, $timestamp) = @_; $self->got_a_reply ($reply, $reply_id); }); The callback can ignore the reply as an invalid packet sent to the listening port if the reply id does not match the return value from bgsend. $nfound = $res->poll_responses() See if there are any "bgsend" response packets ready, and return the number of such packets delivered to their callbacks. $res->bgabort() Call this to release pending requests from memory, when aborting backgrounded requests, or when the scan is complete. "Mail::SpamAssassin::PerMsgStatus::check" calls this before returning. $packet = $res->send($name, $type, $class) Emulates "Net::DNS::Resolver::send()". $res->errorstring() Little more than a stub for callers expecting this from "Net::DNS::Resolver". If called immediately after a call to $res->send this will return "query timed out" if the $res->send DNS query timed out. Otherwise "unknown error or no error" will be returned. No other errors are reported. $res->finish_socket() Reset socket when done with it. $res->finish() Clean up for destruction. perl v5.12.1 2010-03-16 Mail::SpamAssassin::DnsResolver(3)
Man Page

Featured Tech Videos