summaryrefslogtreecommitdiff
path: root/README.md
blob: 4c4e6a068818dc92de69c61fbc1e3460ab9e9990 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# he-dyndns
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 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
dns.he.net. Otherwise, you can provide it on the command line with the
**-s** option.

The **/etc/he-dns-secret** file is sourced into the Bash environment by the
script. It can contain any shell code that can execute when being called with
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.

# Usage
```
usage: he-dyndns [-h] [--v4] [--v6] [--addr4 ADDR4] [--addr6 ADDR6] [--key KEY] [--debug] record

Update Hurricane Electric DNS dynamic record

positional arguments:
  record         DNS record to update

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. Failures also
include a single line error message.