=pod

=head1 NAME

 cpanel-dnsupdater.pl

=head1 VERSION

 0.8.8

=head1 USAGE

 cpanel-dnsupdater.pl [options]

 Example:
 cpanel-dnsupdater.pl --host home --domain domain.tld --cpanel_user cptest --cpanel_pass 12345 --cpanel_domain cptest.tld --check_host 8.8.8.8

=head1 DESCRIPTION

 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.

=head1 ARGUMENTS

=head2  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

=head2  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)

=head2 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'

=head1 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.

=head1 AUTHOR

 Paul Trost <ptrost@cpanel.org>
 Original code by Stefan Gofferje - http://stefan.gofferje.net/

=head1 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>
