Skip to content

Commit 184dd00

Browse files
committed
Update README
1 parent a2c74c3 commit 184dd00

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ddns-proxy
2+
3+
I'm using [ddns-updater](https://github.com/qdm12/ddns-updater) on multiple hosts to update my dynamic DNS (DDNS) records. Each host needs to update a single DNS record, but to do so they need to have an API key with full access to the entire DNS zone (a limitation of the Cloudflare API). This is not ideal for security reasons, so I created this proxy to allow each host to update only a single record.
4+
5+
```mermaid
6+
flowchart LR
7+
host-a[Host A] --> ddns
8+
host-b[Host B] --> ddns
9+
host-c[Host C] --> ddns
10+
host-d[Host D] --> ddns
11+
ddns[ddns-proxy] --> cloudflare[Cloudflare API]
12+
```
13+
14+
Note: this is a hobby project, mainly to play around with .NET Native AOT. I'm using it internally only, so security is not a primary concern. Use at your own risk!
15+
16+
## Usage
17+
18+
1. [Create an API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) in Cloudflare that has read & write permissions for the DNS zone(s) you want to update
19+
1. Create the DNS record(s) you want to update
20+
1. Start the `ddns-proxy` container with the API token, for example using Docker Compose:
21+
```yaml
22+
services:
23+
ddns-proxy:
24+
image: ghcr.io/louismt/ddns-proxy:latest
25+
environment:
26+
- CLOUDFLARE__APITOKEN=your_api_token
27+
- DDNS__RECORDS__0__KEY=some_unique_key
28+
- DDNS__RECORDS__0__ZONEID=your_zone_id
29+
- DDNS__RECORDS__0__DNSRECORDID=your_dns_record_id
30+
ports:
31+
- 8080
32+
```
33+
1. To get the DNS record ID(s), you can call `http://docker-ip:8080/list?zoneId=your_zone_id`
34+
1. Add as many records to the configuration as you need, using unique keys for each record
35+
1. Configure ddns-updater on each host to use the `ddns-proxy` as the endpoint, for example:
36+
```json
37+
{
38+
"provider": "custom",
39+
"domain": "example.com",
40+
"url": "http://docker-ip:8080/update?key=some_unique_key",
41+
"ipv4key": "ipv4",
42+
"ipv6key": "ipv6",
43+
"success_regex": "\"success\":true",
44+
}
45+
```

0 commit comments

Comments
 (0)