NAME

Net::DNS::CloudFlare::DDNS - Object orientated Dynamic DNS interface for CloudFlare

VERSION

Version 0.04

SYNOPSIS

Provides an object orientated interface that can be used to dynamically update DNS records on CloudFlare.

use Net::DNS::CloudFlare::DDNS;

my $ddns = Net::DNS::CloudFlare::DDNS->new($config);
my $ddns->update();
...

METHODS

new

Create a new Dynamic DNS updater

my $ddns = Net::DNS::CloudFlare::DDNS->new(
    # Required
    user => $cloudflare_user,
    apikey => $cloudflare_api_key,
    zones => $dns_zones,
    # Optional
    verbose => $verbosity
);

The zones argument must look like the following

    [
        { 
            zone => $zone_name_1,
            domains => [
                $domain_1, ..., $domain_n
            ]
	},
        ...
        { 
            zone => $zone_name_n,
            domains => [
                $domain_1, ..., $domain_n
            ]
	}
    ]

Each domain must be an A record within that zone, use undef for the zonne itself

update

Updates CloudFlare DNS with the current IP address if necessary

$ddns->update();

verbose

Accessor for verbose attribute, set to print status information.

# Verbosity on
$ddns->verbose(1);

# Verbosity off
$ddns->verbose(undef);

# Print current verbosity
say $ddns->verbose;

_ip

Accessor for the IP attribute.

# Set IP
$ddns->_ip($ip);

# Get IP
my $up = $dds->_ip;

_getIP

Trys to grab the current IP from a number of web services

# Get current IP
my $ip = $ddns->_getIP;

_getDomainIds

Gets and builds a map of domains to IDs for a given zone

# Get domain IDs
$ddns->_getDomainIds($zone);

BUILD

Expands subdomains to full domains and attaches domain IDs

AUTHOR

Peter Roberts, <me+dev at peter-r.co.uk>

BUGS

Please report any bugs or feature requests to bug-net-dns-cloudflare-ddns at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-DNS-CloudFlare-DDNS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Net::DNS::CloudFlare::DDNS

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2013 Peter Roberts.

This program is distributed under the MIT (X11) License: http://www.opensource.org/licenses/mit-license.php

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.