Skip to content

Commit 509eff5

Browse files
authored
docs: add DigitalOcean DDNS example and split DNS guidance (#267)
1 parent 03ba2be commit 509eff5

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

ddns.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,41 @@ Additional notes:
8585
- Consider enabling logging for the DDNS service to monitor updates and troubleshoot any issues.
8686
- Some providers may offer advanced features like wildcards and subdomain updates. Explore these options based on your specific needs.
8787

88+
Example: DigitalOcean (DO)
89+
^^^^^^^^^^^^^^^^^^^^^^^^^^
90+
91+
The following example uses the fictional ``firewall.example.net`` setup on NethSecurity.
92+
The DigitalOcean API token is intentionally redacted; replace it with your own token. ::
93+
94+
uci set ddns.do=service
95+
uci set ddns.do.service_name='digitalocean.com-v2'
96+
uci set ddns.do.lookup_host='firewall.example.net'
97+
uci set ddns.do.domain='example.net'
98+
uci set ddns.do.username='firewall'
99+
uci set ddns.do.password='REDACTED_DIGITALOCEAN_API_TOKEN'
100+
uci set ddns.do.param_opt='21694203'
101+
uci set ddns.do.enabled='1'
102+
uci set ddns.do.interface='wan'
103+
uci set ddns.do.ip_source='network'
104+
uci set ddns.do.ip_network='wan'
105+
uci commit ddns
106+
/etc/init.d/ddns restart
107+
108+
The relevant DigitalOcean fields are:
109+
110+
- ``domain``: the domain managed in DigitalOcean
111+
- ``username``: the hostname label to update
112+
- ``password``: the personal access token
113+
- ``param_opt``: the DNS record ID for that hostname
114+
115+
To list the records and find the ID, run::
116+
117+
curl -X GET -H 'Content-Type: application/json' \
118+
-H "Authorization: Bearer TOKEN" \
119+
"https://api.digitalocean.com/v2/domains/DOMAIN/records"
120+
121+
Replace ``TOKEN`` and ``DOMAIN`` with your own values.
122+
88123
Example: afraid.org (FreeDNS)
89124
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90125

@@ -135,6 +170,20 @@ The domain is named "nstest1.freeddns.it" and the username and password are "nst
135170
uci commit ddns
136171
/etc/init.d/ddns restart
137172

173+
Split DNS
174+
---------
175+
176+
Some deployments publish the same hostname inside the LAN and on the public internet.
177+
If ``lookup_host`` resolves to a private address on the firewall itself, DDNS can compare the public WAN IP against the internal answer and keep retrying even when the provider update succeeded.
178+
179+
The recommended fix is to make DDNS query an external resolver for the lookup instead of the local split-DNS answer. For example::
180+
181+
uci set ddns.do.dns_server='1.1.1.1'
182+
uci commit ddns
183+
/etc/init.d/ddns restart
184+
185+
This keeps split DNS for LAN clients while the DDNS client validates the public record.
186+
138187
Using Luci
139188
----------
140189

0 commit comments

Comments
 (0)