DNS-EasyDNS
view release on metacpan or search on metacpan
lib/DNS/EasyDNS.pm view on Meta::CPAN
package DNS::EasyDNS;
our $VERSION = 0.04;
#==============================================================================#
=head1 NAME
DNS::EasyDNS - Update your EasyDNS dynamic DNS entries
=head1 SYNOPSIS
use DNS::EasyDNS;
my $ed = DNS::EasyDNS->new;
$ed->update( username => "foo", password => "bar" ) || die "Failed: $@";
=head1 DESCRIPTION
This module allows you to update your EasyDNS ( http://www.easydns.com/ )
dynamic DNS records. This is done via an http get using the L<libwww-perl>
modules.
=head1 METHODS
=over 4
=cut
#==============================================================================#
package DNS::EasyDNS;
use strict;
use warnings;
use Carp;
use LWP::UserAgent;
use CGI::Util qw(escape);
use HTTP::Request::Common qw(GET);
use base qw(LWP::UserAgent);
use constant URL => 'members.easydns.com/dyn/dyndns.php';
#==============================================================================#
=item DNS::EasyDNS->new();
Create a new EasyDNS object. This is actually an inheritted L<LWP::UserAgent>
so you may like to use some of the UserAgent methods. For example,
if you are behind a proxy server:
$ed->proxy('http', 'http://proxy.sn.no:8001/');
=cut
sub new {
my ($pack,@args) = @_;
my $obj = $pack->SUPER::new(@args);
$obj->agent("DNS::EasyDNS perl module");
return $obj;
}
sub _can_do_https {
eval "use Crypt::SSLeay";
if ($@) {
return;
} else {
return 1;
}
}
#==============================================================================#
=item $ed->update(%args);
Updates your EasyDNS dynamic DNS records. Valid C<%args> are:
=over 8
C<username> - Your EasyDNS login name. This is required.
C<password> - The corresponding password. This is required.
C<hostname> - The full host being updated. This is required.
C<tld> - The root domain of your hostname, for example if your hostname is
"example.co.uk" you should set "tld" to "co.uk".
C<myip> - The IP address of the client to be updated. Use "0.0.0.0" to set
record to an offline state (sets record to "offline.easydns.com"). This
defaults to the IP address of the incoming connection (handy if you are
being natted).
C<mx> - Use this parameter as the MX handler for the domain being updated,
it defaults to preference 5.
( run in 1.979 second using v1.01-cache-2.11-cpan-389fe586d7c )