Adjust the update error handling path to avoid hard failures on
recoverable errors. This allows ddns to retry updates after the
configured retry interval and improves reliability.
Signed-off-by: Tim Flubshi <flubshi@gmail.com>
Add a new netcup DDNS provider using the netcup DNS api
(ccp.netcup.net) with API key authentication.
Configuration mapping:
* username = netcup customer number
* password = netcup API password
* param_enc = netcup API key (generated in the CCP)
* domain = fully qualified subdomain to update (e.g. home.example.de)
* param_opt = (optional) root/zone domain override (e.g. example.de)
When omitted the root domain is derived by stripping the
leftmost label from 'domain'. This only works correctly for
a single subdomain level (e.g. "home.example.de").
param_opt MUST be set explicitly in two cases:
1. Deep subdomains: domain=test.internal.example.org
2. ccSLD apex domains: domain=example.co.nz
Signed-off-by: Tim Flubshi <flubshi@gmail.com>
The 'ddns-scripts' packages still uses not the procd service handling.
This commit changes this.
This change also resolves the issue where, if a UCI configuration is
already present, the process is blocked during installation via APK and
does not complete.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Tested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
records
Problem:
When using Cloudflare with proxy enabled (orange cloud), DNS lookups
return Cloudflare's edge IP instead of the actual origin IP registered
in the dashboard. This causes ddns-scripts to incorrectly detect IP
mismatches, triggering unnecessary updates and potential rate limiting.
Solution:
Add an optional 'use_api_check' configuration option that enables
provider scripts to fetch the registered IP directly via their API,
bypassing DNS lookups.
Changes:
- dynamic_dns_functions.sh: Add API check block to get_registered_ip()
(~25 lines). When use_api_check is enabled, sources the provider
script with GET_REGISTERED_IP=1 flag. Falls back to DNS lookup if
API check is disabled, unsupported, or fails.
- update_cloudflare_com_v4.sh: Add handler for GET_REGISTERED_IP mode
(~15 lines). Reuses existing cURL setup and authentication to query
Cloudflare API for actual record content.
- etc/config/ddns: Document use_api_check option
Behavior:
- use_api_check=0 or unset: DNS lookup (existing behavior, no changes)
- use_api_check=1 with API support: API query for registered IP
- use_api_check=1 without API support: Falls back to DNS lookup
- API failure: Gracefully falls back to DNS lookup
Testing:
- Cloudflare (proxied): Correctly retrieves origin IP via API
- Cloudflare (non-proxied): Works correctly
- No-IP: DNS lookup works (no regression)
- IPv4 and IPv6 records tested
- API failure gracefully falls back to DNS
Signed-off-by: Wayne King 244781262+bdk38@users.noreply.github.com
For reasons that have not been investigated in detail, the package blocks
during 'postinst' with the new 'apk' backend when the package is installed
on the target.
After much back and forth, it turned out that the '/etc/init.d/ddns start'
command is responsible for this. The call is blocking.
The command '/etc/init.d/ddns enabled' in the 'postinst' also makes no sense
here, as it only checks whether the ddns service is enabled. The return value
is not checked at all. And the 'prerm' script is also not needed, as the
calls made there are implicitly called during package deinstallation.
Therefore, this commit removes the entire and not needed 'postinst' and
'prerm' script call.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This was overlooked. Therefore, the package could not be built.
Fixes: e9fe0249f6 ("ddns-scripts: Fix Hetzner Cloud naming")
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
In the original commit I used the wrong name for the package in the
Makefile and various other files which caused the package to not build.
Unify the naming to "cloud" to fix the package build.
Fixes: 5ee205bd31 ("ddns-scripts: add Hetzner Cloud support")
Signed-off-by: Christopher Obbard <obbardc@gmail.com>
Add a new Hetzner DDNS provider using the Hetzner Cloud API
(api.hetzner.cloud) with Bearer token authentication.
Configuration guide:
* set [domain] to domain
* set [username] to subdomain (without domain)
* set [password] to Bearer API key
Signed-off-by: Christopher Obbard <obbardc@gmail.com>
new service provider namesilo.com
config guide:
* set [domain] to apex domain
* set [username] to subdomain (without apex domain)
* set [password] to api key
Signed-off-by: Lin Fan <im.linfan@gmail.com>
Redirect stdout and stderr to /dev/null when starting/restarting the ddns
service in the background. Without this redirection, file descriptors are
inherited by the child process, preventing proper process detachment and
causing luci's XHR requests to timeout.
Add support for ApertoDNS dynamic DNS service with two configuration
options:
- apertodns.com: Standard DynDNS2 compatible authentication (user/pass)
- apertodns.com-token: Token-based authentication for DDNS clients
Both configurations support IPv4 and IPv6 updates via the standard
/nic/update endpoint.
Signed-off-by: Andrea Ferro <support@apertodns.com>
To check if the update was successful.
Not all DDNS implementations have such huge latencies updating their services.
nsupdate for example, updates immediately and the update is immediately checkable.
Add new check_interval_min value to be able to set a check interval lower than the
previously hard-coded 5 minutes.
Fixes: #20564
Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
According to [1] Basic Auth seems to be broken since a while for he.net.
The documentation [2] is outdated, and still mentions Basic Auth, but
switching to parameter-based authentication seems to fix the issue.
It also bumps PKG_RELEASE in order to ensure a new version is packaged.
[1]: https://github.com/openwrt/packages/issues/27593
[2]: https://dns.he.net/docs.html
Signed-off-by: Karol Babioch <karol@babioch.de>
OVH changed its API to update DNS records. It now requires HTTP Basic
Authorization header. As such the default ddns-script method to update
the DNS record is failing. The fix is to move DNS record updates into
its own script/package.
Signed-off-by: David Andreoletti <david@andreoletti.net>
Calculating the next check time based on the last update time is not
very accurate if the next check is a large multiple forwards from the
last update time because the cumulative sleeps and wake times are not
exact but best effort of the OS. Other factors including clock-drift
give rise to a larger time discrepancy the further the next update is in
the future.
Stash the next check time which should be quite accurate since it's
only one sleep instance away. This is also for use in the GUI.
Tested on 24.10.2
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Add back the regex searching for valid IP address when getting IP
address via web.
Fixes: 9cdd1a1660 ("ddns-scripts: refactor get_current_ip()")
Signed-off-by: Qian Suyao <qiansuyao@gmail.com>
User can (optionally) set zone_id and dns_record_id in param_opt.
This allows round robin DNS setup in Cloudflare.
Signed-off-by: Eric Leung <contact@ericleung.dev>
Remove the awk based ifconfig output handling violence (omg) and instead
use the ip utility and its JSON output: this uses the available
system utility jsonfilter. Much cleaner and less brittle.
This fixes alias interface handling
Fixes issue #24922
Add dep 'ip' (iproute2: ip-tiny, ip-full)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Leverage the resolveip utility - it does the same job that several
different resolvers do for a fraction of the resource usage. This...
to verify a host's connectivity.
resolveip dependency net delta: +2-3Kbytes
Also uses the ddns-scripts built-in 'timeout' function.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Compatible with domain without the `@` symbol, consistent with the previous.
Fixes 8c55d089 ("ddns-scripts: fix parsing of parameters for cloudflare.com")
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
There is an obvious bug here:
if we want to update example.com.example.com in zone example.com,
so `domain=example.com@example.com`, after parsing,
the `__HOST` will be `example.com`, not expected `example.com.example.com`.
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
The 'ps' command from 'procps-ng' is used in favour of 'ps' from 'busybox'
when 'procps-ng' is installed. The problem is that the outputs are not
compatible and the ‘grep’ is different for further processing. To fix this,
always use the 'ps' command from 'busybox'.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
ddns-scripts-scaleway description section was not defined as such and was
overriding the package definition leading to:
Makefile:839: *** missing separator. Stop.
Fixes: a7867016c8 ("ddns-scripts: add support for Scaleway DNS")
Signed-off-by: Robert Marko <robimarko@gmail.com>
Script will exit when an error occurred.
Modify write_log 14 to write_log 4,
write_log 14 and write_log 4 can also print the same message,
but write_log 14 will exist script when printed.
Signed-off-by: Lehua Zhang <sxlehua@qq.com>
DigitalOcean API requires a "type" JSON field to update a DNS
record. This adds that while checking for IPv6 to change which
record type to use. Without it, the API call fails, making
the script unable to update the DNS records for DigitalOcean.
Signed-off-by: Adam Beck <subcursion@gmail.com>
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.
These scripts use 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.
In case if we don't use pppoe connection - 'l3_device' is equal to real device.
Follow P/R:
#14431
Signed-off-by: Coia Prant <coiaprant@gmail.com>
Using the PUT method recreates the DNS record with and only with
the newly provided data. This seems unnecessary. In particular,
we don't need to hardcode a TTL of 120. Any existing comment
would be lost too.
The only detail we need to change is the IP address. Leave everything
else as it was.
Signed-off-by: Gedalya Nie <gedalya@gedalya.net>