NAME
Net::DynDNS::GoDaddy - Provides Dynamic DNS functionality for your GoDaddy domains
SYNOPSIS
use
Net::DynDNS::GoDaddy;
use
Addr::MyIP;
my
$hostname
=
'home'
;
my
$domain
=
'example.com'
;
my
$current_host_ip
= host_ip_get(
$host
,
$domain
);
my
$my_ip
= myip();
if
(
$current_host_ip
ne
$my_ip
) {
host_ip_set(
$host
,
$domain
,
$my_ip
);
}
DESCRIPTION
For end-users, see the documentation for the update-ip binary.
Provides an interface to allow dynamically updating your GoDaddy domain's DNS name to IP mapping.
You must have a ~/godaddy_api.json
file containing your GoDaddy API key and secret, in the following format:
{
"api_key"
:
"KEY DATA"
,
"api_secret"
:
"API SECRET"
}
The update-ip binary binary will do this for you automatically on first run.
FUNCTIONS
host_ip_get($host, $domain)
Returns the currently set IP address of the DNS A record for the host/domain pair.
Parameters:
$host
Mandatory, String: The name of the host, eg. www
.
$domain
Mandatory, String: The name of the domain, eg. example.com
.
Returns: String, the IP address that's currently set for the record.
host_ip_set($host, $domain, $ip)
Updates the DNS A record for the host/domain pair.
Parameters:
$host
Mandatory, String: The name of the host, eg. www
.
$domain
Mandatory, String: The name of the domain, eg. example.com
.
$ip
Mandatory, String: The IP address to set the record to eg. 192.168.10.10
.
Returns: Bool, 1
on success, 0
on failure.
api_key_get
Fetch your GoDaddy API key and secret from the previously created godaddy_api.json
in your home directory.
Not exported by default, use the qw(:all)
tag to access it.
Croaks if the file can't be read.
Returns: A list of two scalars, the API key and the API secret.
api_key_set($key, $secret)
Creates the godaddy_api.json
file in your home directory that contains your GoDaddy API key and secret.
Not exported by default, use the qw(:all)
tag to access it.
Parameters:
$key
Mandatory, String: Your GoDaddy API key
$secret
Mandatory, String: Your GoDaddy API secret
Returns: 1
upon success.
AUTHOR
Steve Bertrand, <steveb at cpan.org>
LICENSE AND COPYRIGHT
Copyright 2022 Steve Bertrand.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at: