Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aureum-cloud/cloudflare-ddns
Cloudflare DDNS is a Go-based DNS updater designed to keep your Cloudflare-managed DNS records in sync with your current public IPv4 and/or IPv6 addresses.
https://github.com/aureum-cloud/cloudflare-ddns
cloudflare ddns dns ipv4 ipv6
Last synced: 5 days ago
JSON representation
Cloudflare DDNS is a Go-based DNS updater designed to keep your Cloudflare-managed DNS records in sync with your current public IPv4 and/or IPv6 addresses.
- Host: GitHub
- URL: https://github.com/aureum-cloud/cloudflare-ddns
- Owner: Aureum-Cloud
- License: mit
- Created: 2024-11-03T15:58:33.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-12-09T21:34:10.000Z (about 2 months ago)
- Last Synced: 2025-01-24T09:07:03.201Z (5 days ago)
- Topics: cloudflare, ddns, dns, ipv4, ipv6
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 72
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Cloudflare DDNS
**Cloudflare DDNS** is a Go application designed to update DNS records on Cloudflare according to your current public IPv4 and/or IPv6 addresses. It reads configuration from a JSON file, retrieves the current IP addresses, and updates DNS records as needed.
## Features
- **Fetches Public IPs**: Retrieves your public IPv4 and IPv6 addresses.
- **Configurable TTL**: Allows setting a custom Time-To-Live (TTL) for DNS records.
- **Automatic Updates**: Supports periodic updates of DNS records with the latest IP address.## Requirements
- **Cloudflare API Token**: Set an environment variable `CLOUDFLARE_API_TOKEN` with your Cloudflare API token.
## Configuration
The script expects a JSON configuration file located at `/etc/config/config.json`. Below is an example configuration:
```json
{
"ipv4_enabled": true,
"ipv6_enabled": false,
"ttl": 300,
"zones": [
{
"id": "d9e353b268c23a9737f5b40b31f92a6f",
"name": "aureum.cloud",
"update_root_domain": true,
"subdomains": [
"www"
]
}
]
}
```### Configuration Fields
- **ipv4_enabled**: Set to `true` to enable IPv4 address updates.
- **ipv6_enabled**: Set to `true` to enable IPv6 address updates.
- **ttl**: Time-To-Live for the DNS records (in seconds). If set to less than 30, defaults to 300 seconds.
- **zones**: An array of DNS zones to update.
- **id**: Cloudflare zone ID.
- **name**: Domain name of the zone.
- **update_root_domain**: Set to `true` to update the root domain.
- **subdomains**: List of subdomains to update.## Usage
### Single Update
To perform a single update of DNS records:
```bash
go run main.go
```### Repeated Updates
To repeatedly update DNS records at the interval specified by the TTL:
```bash
go run main.go --repeat
```### Running with Docker
To run this script in a Docker container, use the following command. Be sure to replace `` with the path to your local configuration file and `` with your actual Cloudflare API token:
```bash
docker run -e CLOUDFLARE_API_TOKEN= -v :/etc/config/config.json ghcr.io/aureum-cloud/cloudflare-ddns:latest
```