A golang client to update, clear ip and records for DuckDNS domains.
You can download and build it from the sources. You have to retrieve the project sources by using one of the following way:
$ go get -u github.com/ebrianne/duckdns-go
# or
$ git clone https://github.com/ebrianne/duckdns-go.git
Install the needed vendors:
$ GO111MODULE=on go mod vendor
Then, build the binary (here, an example to run on Raspberry PI ARM architecture):
$ GOOS=linux GOARCH=arm GOARM=7 go build -o duckdns-go .
The client has been made available as a docker image. You can simply run it by the following command and pass the configuration with environment variables.
By default it executes ./duckdns-go -update-ip.
docker run \
-e 'DUCKDNS_TOKEN=<token>' \
-e 'DUCKDNS_DOMAINS=<domains>' \
ebrianne/duckdns-go
You can also provide the command to run
docker run \
-e 'DUCKDNS_TOKEN=<token>' \
-e 'DUCKDNS_DOMAINS=<domains>' \
ebrianne/duckdns-go ./duckdns-go [ARG]
$ ./duckdns-go -duckdns_token <token> -duckdns_domains <domain> -update-ip
I0113 11:17:15.063439 426646 configuration.go:86] ---------------------------------------
I0113 11:17:15.063895 426646 configuration.go:87] - DuckDNS client configuration -
I0113 11:17:15.064026 426646 configuration.go:88] ---------------------------------------
I0113 11:17:15.064115 426646 configuration.go:94] Token : **************
I0113 11:17:15.064135 426646 configuration.go:94] DomainNames : [******]
I0113 11:17:15.064146 426646 configuration.go:94] Record :
I0113 11:17:15.064151 426646 configuration.go:94] IPv4 :
I0113 11:17:15.064166 426646 configuration.go:94] IPv6 :
I0113 11:17:15.064177 426646 configuration.go:94] Interval : 1h0m0s
I0113 11:17:15.064187 426646 configuration.go:94] UpdateIP : true
I0113 11:17:15.064220 426646 configuration.go:97] ---------------------------------------
I0113 11:17:15.064242 426646 client.go:96] Sending request to https://www.duckdns.org/update?domains=******&token=**************&ip=
I0113 11:17:15.940591 426646 main.go:71] Got response OK
I0113 11:17:15.940629 426646 main.go:72] IP has been updated at 2021-01-13 11:17:15.940624102 +0100 CET m=+0.877805589
Usage of ./duckdns-go:
-auto-ip
Get public ipv4 and ipv6 via whatismyipaddress.com
-clear-record
Clear txt record in duckdns with clear=true
-duckdns_domains value
List of duckdns domains to update (default duckdns_domains)
-duckdns_token string
DuckDNS Token (mandatory)
-get-record
Get txt record
-ipv4 string
IPv4 address (optional)
-ipv6 string
IPv6 address (optional)
-record string
TXT record (mandatory with -update-record/-clear-record flags)
-update-ip
Update IP routine
-update-record
Update TXT record routine
-update_interval duration
Interval between IP updates (min 10 mins) (default 1h0m0s)
-verbose
Verbose flag for duckdns response
All CLI commands can be specified as an environment variable such as:
export DUCKDNS_TOKEN="<your token>"
export DUCKDNS_DOMAINS="domain1,domain2" #use space comma separated names
duckdns
Content type
Image
Digest
Size
1.9 MB
Last updated
over 5 years ago
docker pull ebrianne/duckdns-go