This script is useful for updating the IP address of an A record on a cPanel hosted domain with either a supplied IP, or a detected IP. This allows you to use your own cPanel domain for dynamic DNS instead of having to use a third party DNS service.
If your specify email address parameters, then script output is emailed to you, otherwise all output is printed to STDOUT.
ARGUMENTS
Required
--host Host name to update in the domain's zonefile. eg. 'www'
--domain Name of the domain to update
--cpanel_user cPanel account login name
--cpanel_pass cPanel account password
--cpanel_domain cPanel account domain name
--check_host IP address of host to check for connectivity. eg. 8.8.8.8 or your DNS resolver
Optional
--ip IP address to update the A record with. This defaults to the detected external IP.
--email_auth_user Email address for SMTP Auth
--email_auth_pass Password for SMTP Auth (use \ to escape characters)
--email_addr Email address to send successful/error report to (defaults to email_auth_user)
--outbound_server Server to send mail through
--helo Change the HELO that is sent to the outbound server, this setting defaults to the current hostname
--config_file Specify the location of a configuration file (defaults to ~/.cpaneldyndns)
Using a Config File (~/.cpaneldyndns)
Instead of passing options on the command line, a configuration file can be used.
Any options specified on the command line will be overriden by the configuration file options.
The file takes the format of 'option=value', eg:
host=home
domain=mydomain.com
The default location of the file is in the home directory of the current user and the default filename is '.cpaneldyndns'
EXIT STATUS
Exits with 1 if there was any issue updating the record, 255 if the end of script was reached in error, and 0 if IP was either changed, or the detected IP matches the given IP.
AUTHOR
Paul Trost <ptrost@cpanel.org>
Original code by Stefan Gofferje - http://stefan.gofferje.net/
LICENSE AND COPYRIGHT
Copyright 2012, 2013, 2014, 2015.
This script is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2, or at your option any later version.
<http://gnu.org/licenses/gpl.html>
About
Dynamic DNS updater using a domain on a cPanel server