Net::DNS::ToolKit::Utilities - a collection of helper utilities
use Net::DNS::ToolKit::Utilities qw(
id
question
revIP
query
dns_udpsend
dns_udpresp
dns_ans
dns_ns
dns_ptr
rlook_send
rlook_rcv
);
$unique = id($seed); $querybuf = question($name,$type); $rev = revIP($ip); $response = query(\$buffer,$timeout); $socket = dns_udpsend(\$buffer,$timeout); $response = dns_udpresp($socket,$timeout); ($aptr,$tptr,$auth_zone) = dns_ans(\$buffer); $nsptr = dns_ns(\$buffer); $hostname = dns_ptr(\$buffer); @hosts = dns_ptr(\$buffer); $socket = rlook_send($IP,$timeout); $hostname = rlook_rcv($socket,$timeout);
Net::DNS::ToolKit::Utilities provides a collection of DNS utilities built from the ToolKit building blocks
input: [optional] seed returns: the last 16 bit number +1
Optionally, the user may supply a seed for the first call. Subsquent calls will return the previous number + 1 (mod 65536). The seed is set when the module is instantiated if no seed is supplied.
input: host or domain name,
query type
returns: query buffer
Supports types T_A, T_TXT, T_ANY, T_MX, T_NS, T_PTR
78.56.34.12 = revIP(12.34.56.78);
input: a dot quad IP address returns: reversed dot quad address
NOTE: this is an operation on ASCII characters, not packed network addresses.
input: pointer to query buffer,
optional timeout (secs, def 30)
returns: socket or undef
input: socket,
optional timeout (secs, def 30)
returns: response buffer
closes: socket
input: DNS answer
returns: pointers to two arrays,
auth_zone name or ''
Returns an empty array unless there is at least ONE A record found.
The first array contains packed IPv4 addresses of the form returned by inet_aton (text). The second array contains text strings.
auth_zone will contain the zone name if an SOA record is found, otherwise it will contain ''.
$ptr->{hostname}--->{addr} = netaddr
|
*->{ttl} = seconds
If no records are found, undef is returned
input: pointer to response buffer returns: pointer to hash or undef
If no records are found, undef or an empty array is returned
input: pointer to response buffer returns: host name or array of hosts
input: dotquad IP address,
optional timeout (sec, def 30)
return: socket or undef
input: receive socket,
optional timeout (sec, def 30)
return: hostname text or undef
IO::Socket
Net::DNS::Codes
Net::DNS::ToolKit
Net::DNS::ToolKit::RR
none by default
id
question
revIP
query
dns_udpsend
dns_udpresp
dns_ans
dns_ns
dns_ptr
rlook_send
rlook_rcv
Copyright 2003, 2004 Michael Robinton <michael@bizsystems.com>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Michael Robinton <michael@bizsystems.com>
the Net::DNS::Codes manpage, the Net::DNS::ToolKit manpage, the Net::DNS::ToolKit::RR manpage,