namesilo_ddns_cli
is a command line tool for Namesilo DDNS, which is written in Bash depending on wget/curl only.
It is designed mainly to reduce dependences and system load as much as possible. Therefore, light-weight Linux distributions are especially appropriate to use it, like Raspberry, Openwrt, Merlin, Unraid, DSM, QTS...
- Rewrite based on Bash builtin commands, and remove all other dependences except for
wget
orcurl
. - No API request needed for normal running by using cache in log, and possible for IP-checking with high frequency.
- Create running log with automatic compression and length control.
- Enable command-line support.
- Multi-Domains Support
- IPv4 & IPv6 Support
- Load Balancing for IP-Check
- Minimal API requests by Cache
- Logging with Length Control
wget
orcurl
Usage: namesilo_ddns.sh <command> ... [parameters ...]
Commands:
--help Show this help message
--version Show version info
--key, -k <apikey> Specify Namesilo API key
--host, -h <host> Add a hostname
--refetch, -r Refetch records from Namesilo
Example:
namesilo_ddns.sh -k c40031261ee449037a4b44b1 \
-h yourdomain1.tld \
-h subdomain1.yourdomain1.tld \
-h subdomain2.yourdomain2.tld
Exit codes:
0 Successfully updating for all host(s)
2 Exist updating failed host(s)
9 Arguments error
Tips:
Strongly recommand to refetch records or clear caches in log,
if your DNS records have been updated by other ways.
You can also edit the configs and settings in the head of script.
-
SSH to your device , and place
namesilo_ddns.sh
into somewhere, like/opt/ddns/
. (Note: For EdgeOS, the script should be placed in/config/scripts/
) -
Make sure your permissions of destination and script:
chmod u+w /opt/ddns
chmod u+x /opt/ddns/namesilo_ddns.sh
- Edit crontab config:
crontab -e
- Insert and save this line (updating the two hosts every 5 minutes):
*/5 * * * * /opt/ddns/namesilo_ddns.sh -k c40031261ee449037a4b44b1 -h subdomain1.yourdomain1.tld -h subdomain2.yourdomain2.tld
-
Place
namesilo_ddns.sh
into somewhere in your NAS, e.g./homes/<yourname>/ddns/
. -
Start
Control Panel
, clickAdvanced Mode
, openTask Scheduler
. -
Access
Create
-->Scheduled Task
-->User-defined script
. -
Toggle to
Schedule
tab, set running every 5 minutes daily. -
Toggle to
Task Settings
tab, inRun command
input edited command below, e.g.
/var/services/homes/<yourname>/ddns/namesilo_ddns.sh -k c40031261ee449037a4b44b1 -h subdomain1.yourdomain1.tld -h subdomain2.yourdomain2.tld
- If you check out
Send run details by email
and... only when ... terminates abnormally
, you will receive mail when occur error.
-
DDNS multiple hosts
-
DDNS IPv6 hosts
-
reduce API requests greatly
-
check updating log
- Edit the API key and hosts in this script, and save as
ddns-start
.
#!/usr/bin/env bash
./namesilo_ddns.sh -k c40031261ee449037a4b44b1 \
-h subdomain1.yourdomain1.tld \
-h subdomain2.yourdomain2.tld
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi
-
SSH to your router and place
ddns-start
andnamesilo_ddns.sh
under/jffs/scripts/
. -
Make sure your permissions of destination and script:
chmod u+w /jffs/scripts
chmod u+x /jffs/scripts/namesilo_ddns.sh
chmod u+x /jffs/scripts/ddns-start
- Log into the router web UI:
- Go to
Advanced Settings
>WAN
>DDNS
- Set
Server
toCustom
- Click the
Apply
button
- Go to