Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hectorm/cloudflare-worker-ddns
Dynamic DNS (DDNS) service implementation for Cloudflare Workers.
https://github.com/hectorm/cloudflare-worker-ddns
cloudflare cloudflare-workers ddns dynamic-dns ubiquiti unifi unifi-controller
Last synced: 5 days ago
JSON representation
Dynamic DNS (DDNS) service implementation for Cloudflare Workers.
- Host: GitHub
- URL: https://github.com/hectorm/cloudflare-worker-ddns
- Owner: hectorm
- License: mit
- Created: 2024-12-28T21:43:10.000Z (5 days ago)
- Default Branch: master
- Last Pushed: 2024-12-28T21:44:14.000Z (5 days ago)
- Last Synced: 2024-12-28T22:24:22.894Z (5 days ago)
- Topics: cloudflare, cloudflare-workers, ddns, dynamic-dns, ubiquiti, unifi, unifi-controller
- Language: JavaScript
- Homepage:
- Size: 0 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Cloudflare Dynamic DNS worker
[Dynamic DNS](https://help.dyn.com/remote-access-api/perform-update/) service implementation for Cloudflare Workers.
## Deployment instructions
1. Create the desired DNS record(s) in Cloudflare.
2. [Deploy the worker](https://developers.cloudflare.com/workers/get-started/).
3. Set the following [variables and secrets](https://developers.cloudflare.com/workers/configuration/secrets/#via-the-dashboard) in the worker dashboard:
- `DDNS_USERNAME`: a username for the Dynamic DNS service.
- `DDNS_PASSWORD`: a password for the Dynamic DNS service.
- `DDNS_RECORD_ALLOWLIST`: a comma-separated list of DNS record(s) that the Dynamic DNS service is allowed to update (optional).
- `CF_API_TOKEN`: a [Cloudflare API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) with the `Zone.DNS:Edit` permission.
4. Test the worker with the following command (optional):
```sh
curl --verbose --user "" "https://..workers.dev/nic/update?hostname=&myip="
```## Setup with UniFi OS
> [!NOTE]
> Tested on UDM-Pro-Max with UniFi OS 4.0.21 (Network 8.6.9 - inadyn 2.12.0).1. Log in to the [UniFi OS Controller](https://unifi.ui.com) web interface.
2. Navigate to `Settings` -> `Internet` -> WAN interface -> `Advanced` -> `Dynamic DNS`.
3. Set the following options:
- `Service`: `custom`.
- `Hostname`: the DNS record to update, must be in the `DDNS_RECORD_ALLOWLIST` if set.
- `Username`: same as the `DDNS_USERNAME` worker variable.
- `Password`: same as the `DDNS_PASSWORD` worker variable.
- `Server`: `..workers.dev/nic/update?hostname=%h&myip=%i`, **do not include** the `https://` scheme (it is added automatically), `%h` and `%i` are placeholders that UniFi OS automatically fills in.
4. Test the configuration by running the following command in the [UniFi OS shell](https://help.ui.com/hc/en-us/articles/204909374-UniFi-Connect-with-Debug-Tools-SSH) (optional):
```sh
inadyn --foreground --once --force --loglevel debug --config /run/ddns-ppp0-inadyn.conf
```