NAME

Net::DNS::CloudFlare::DDNS - Object Orientated Dynamic DNS Interface to CloudFlare DNS

VERSION

version 0.06_1

SYNOPSIS

Provides an object orientated dynamic DNS interface for CloudFlare

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

my $ddns = Net::DNS::CloudFlare::DDNS->new(
    user   => $CF_USER,
    apikey => $CF_KEY,
    zones  => $ZONE_CONF
);
my $ddns->update();
...

ATTRIBUTES

verbose

Whether or not the object should be verbose

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

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

# Print current verbosity
say $ddns->verbose;

METHODS

new

Create a new Dynamic DNS object

my $ddns = Net::DNS::CloudFlare::DDNS->new(
    # Required
    user    => $CF_USER,
    apikey  => $CF_KEY,
    zones   => $ZONE_CONF,
    # Optional
    verbose => $VERB_LVL
);

The zones specifies the zones and records which will be updated. Its structure is as follows

# Array of
[
    # Hashes of
    {
        # DNS Zone
        zone    => $zone_name_1,
        # Domains to be updated in this zone
        domains => [
            $domain_1, ..., $domain_n
        ]
    },
    ...
    {
        zone    => $zone_name_n,
        domains => [
            $domain_1, ..., $domain_n
        ]
    }
]

Each domain is an A record within a zone or undef for the zone itself

update

Updates CloudFlare DNS with the current IP address if necessary

$ddns->update

AUTHOR

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

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Peter Roberts.

This is free software, licensed under:

The MIT (X11) License