-
-
21 Apr 2016 09:50:02 UTC
- Development release
- Distribution: Net-RNDC
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (2)
- Testers
- Kwalitee
Bus factor: 1- License: perl_5
- Activity
24 month- Tools
- Download (20.22KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Net::RNDC - Speak the BIND Remote Name Daemon Control (RNDC) V1 protocol
VERSION
version 0.004
SYNOPSIS
Simple synchronous command/response:
use Net::RNDC; my $rndc = Net::RNDC->new( host => '127.0.0.1', port => 953, # Defaults to 953 key => 'abcd', ); if (!$rndc->do('status')) { die "RNDC failed: " . $rndc->error; } print $rndc->response;
All arguments to new() are allowed in do:
my $rndc = Net::RNDC->new(); my $key = 'abcd'; for my $s (qw(127.0.0.1 127.0.0.2)) { if (!$rndc->do('status', key => $key, host => $s)) { my $err = $rndc->error; } else { my $resp = $rndc->response; } }
DESCRIPTION
This package provides a synchronous, easy to use interface to the RNDC V1 protocol. For more mid-level control, see Net::RNDC::Session, and for absolute control, Net::RNDC::Packet.
Constructor
new
Net::RNDC->new(%args);
Optional Arguments:
key - The Base64 encoded HMAC-MD5 private key to use.
host - The hostname/IP of the remote server to connect to. If IO::Socket::INET6 is installed, IPv6 support will be enabled.
port - The port to connect to. Defaults to 953.
sock - A package, like IO::Socket::INET, that provides a
new
function which returns an object capable of performingsend
,recv
, andclose
, and behaving similar to them. Seeperldoc -f
for each of the methods above to see how they should behave. Defaults to IO::Socket::INET6 if available, otherwiseIO::Socket::INET
. Thenew
function should accept one parameter - PeerAddr - which will be a hostname:port string.
Methods
do
$rndc->do($command); $rndc->do($commands, %args);
Connects to the remote nameserver configured in "new" or passed in to %args and sends the specified command.
Returns 1 on success, 0 on failure.
Arguments:
$command - The RNDC command to run. For example:
status
.
Optional Arguments - See "new" above.
error
$rndc->error;
Returns the last string error from a call to "do", if any. Only set if "do" returns 0.
response
$rndc->response;
Returns the last string response from a call to "do", if any. Only set if "do" returns 1.
SEE ALSO
Net::RNDC::Session - Manage the 4-packet RNDC session
Net::RNDC::Packet - Low level RNDC packet manipulation.
AUTHOR
Matthew Horsfall (alh) <WolfSage@gmail.com>
LICENSE
You may distribute this code under the same terms as Perl itself.
Module Install Instructions
To install Net::RNDC::Packet, copy and paste the appropriate command in to your terminal.
cpanm Net::RNDC::Packet
perl -MCPAN -e shell install Net::RNDC::Packet
For more information on module installation, please visit the detailed CPAN module installation guide.