A Posix Shell Script (Bash-compatible) for tracking your IP address (at home, or on devices).
mkdir -p ~/bin/
my_branch="v1"
curl -fsSL -o ~/bin/duckdns.sh \
"https://raw.githubusercontent.com/BeyondCodeBootcamp/DuckDNS.sh/${my_branch}/duckdns.sh"
chmod a+x ~/bin/duckdns.sh
USAGE
duckdns.sh <subcommand> [arguments...]
SUBCOMMANDS
myip - show this device's ip(s)
ip <subdomain> - show subdomain's ip(s)
list - show subdomains
auth <subdomain> - add Duck DNS token
update <subdomain> - update subdomain to device ip
set <subdomain> <ip> [ipv6] - set ipv4 and/or ipv6 explicitly
clear <subdomain> - unset ip(s)
run <subdomain> - check ip and update every 5m
enable <subdomain> - enable on boot (Linux) or login (macOS)
disable <subdomain> - disable on boot or login
help - show this menu
duckdns.sh myip
duckdns.sh ip foo
duckdns.sh list
duckdns.sh auth foo
duckdns.sh update foo
duckdns.sh set foo 127.0.0.1
duckdns.sh set foo ::1
duckdns.sh set foo 127.0.0.1 ::1
duckdns.sh clear foo
duckdns.sh run foo
duckdns.sh enable foo
duckdns.sh disable foo
You'll need to create your account, subdomain, and token before you can use duckdns.sh
.
-
Login to https://duckdns.org and create a subdomain, such as
CHANGE-ME
forCHANGE-ME.duckdns.org
-
Copy your DNS Token
-
Create your subdomain token env file:
duckdns.sh auth CHANGE_ME
or
# create the env file mkdir -p ~/.config/duckdns.sh/ touch ~/.config/duckdns.sh/CHANGE_ME.env # write your token to the env file vim ~/.config/duckdns.sh/CHANGE_ME.env
DUCKDNS_TOKEN=xxxxxxxx-xxxx-4xxx-8xxx-xxxxxxxxxxxx
CC0-1.0 (Public Domain)
See https://creativecommons.org/publicdomain/zero/1.0/.