diff options
| -rw-r--r-- | README.md | 79 |
1 files changed, 26 insertions, 53 deletions
@@ -1,14 +1,17 @@ # he-dyndns -This code is a shell-based dynamic DNS client for Hurricane Electric's -dns.he.net service. This code is designed to be maximally portable -using common Linux/BSD commands and avoid Perl, Python, etc. In its -default mode, it updates one or more FQDNs with the IP address that -dns.he.net detects as the source request. +A Python-based script to update dynamic DNS records when using the +Hurricant Electric DNS service at ``dns.he.net``. This code is +designed to ba maximally portable by relying on standard +Python 3 libraries. It is not compatible with Python 2. # Installation -There is really nothing to install. Copy he-dyndns somewhere useful +There is really nothing to install unless you need to add +Python3 stock libraries to your system. Copy he-dyndns somewhere useful such as /usr/local/bin. +For Debian/Ubuntu systems: apt install python3-dns python3-urllib3 +For Fedora systems: dnf install python3-dns python3-urllib3 + # Configuration The only configuration file/item is if you want to use the file /etc/he-dns-secret to contain the key for authenticating to @@ -21,55 +24,25 @@ a "source" function. The only key thing that matters is that the variable CODE is defined by the script. Since this file will be sourced into the program, ensure proper security is applied to this file. -# Runtime Options -**he-dyndns** takes the following options: - -## Requied Options -- **-4**: Update the IPv4 "A" record for the FQDN(s). Note that to use this option, -the system making the call must be able to reach dyn.dns.he.net with an IPv4 address. -NAT is okay. Without using **-a** then the public address or public NAT address is -what is set for the FQDN(s). - -- **-6**: Update the IPv6 "AAAA" record for the FQDN(s). Note that to use this option, -the system making the call must be able to reach dyn.dns.he.net with an IPv6 address. - -- **-d**: One or more fully-qualified host entries for the domain separated by commas - -Note that one or both of -4 and -6 must be specified for the script to -actually do anything. Not specifing at least one of them will result in a -successful script exit with no actions being taken. - -## Optional Options -- **-a**: Use the supplied IPv4 address instead of allowing HE DNS to auto-set -based on source. Note that the address is not validated for well-formedness. +# Usage +``` +usage: he-dyndns [-h] [--v4] [--v6] [--addr4 ADDR4] [--addr6 ADDR6] [--key KEY] [--debug] record -- **-A**: Use the supplied IPv6 address instead of allowing HE DNS to auto-set -based on source. Note that the address is not validated for well-formedness. +Update Hurricane Electric DNS dynamic record -- **-s**: The secret key for updating the entries. This overrides any -existing /etc/he-dns-secret file, if one exists. +positional arguments: + record DNS record to update -Any other unsupported option or no options will print a usage message. +optional arguments: + -h, --help show this help message and exit + --v4 Update IPv4 A record (default) + --v6 Update IPv6 AAAA record + --addr4 ADDR4 Update A record with provided IP rather than detected IP + --addr6 ADDR6 Update AAAA record with provided IP rather than detected IP + --key KEY HE DDNS key for record (by default read from /etc/he-dns-secret) + --debug Enable debug logging +``` # Return Values -Returns 0 on success or 1 on failure. Failure message returns the exact error -from dyn.dns.he.net, no more and no less. - -# Note on Proxies -If you have curl(1) configured at a system or user profile level to use a -proxy or be proxy aware, this script will likely produce undesired results. -You must do one of two things: - -1) Configure the environment this script runs in to suppress proxy configuration - -2) Use the -a and -A flags to set the IP addresses manually - -Otherwise, the HE DNS service will auto-detect the proxy address and not the host address. - -# Usage -This script is designed to be called from a Cron entry or another script. An -example usage: - -``` -# /usr/local/bin/he-dyndns -46 -s SECRETKEY -d foo.example.com,bar.example.com -``` +Returns 0 on success or 1 on failure. Failures also +include a single line error message. |
