DDNSGo is a simple Dynamic DNS program built in Go. It automatically updates your DNS records when your IP address changes.
- Lightweight and efficient
- Supports Cloudflare as a DNS provider
- Configurable via environment variables or YAML file
- Easy to set up and use
Currently, DDNSGo supports the following DNS providers:
- Cloudflare
We plan to add support for more providers in the future. Contributions are welcome!
You can configure DDNSGo using environment variables or a YAML config file.
Create a file named ddnsgo.yaml with the following structure:
provider: cloudflare
cloudflare:
api_token: XXXXXXX # API token (create in your Cloudflare profile)
zone_id: BBBBBB # The zone ID (found on the main page of your zone)
record_id: RRRRR # Get it via API (see below)
record_name: DDDD # Subdomain to updateAlternatively, you can use the following environment variables:
DDNSGO_PROVIDER=cloudflare
DDNSGO_CLOUDFLARE_API_TOKEN=XXXXXXX
DDNSGO_CLOUDFLARE_ZONE_ID=BBBBBB
DDNSGO_CLOUDFLARE_RECORD_ID=RRRRR
DDNSGO_CLOUDFLARE_RECORD_NAME=DDDD
To get the record_id, use the following curl command:
curl --request GET \
--url https://api.cloudflare.com/client/v4/zones/YOUR_ZONE_ID/dns_records \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' | jqReplace YOUR_ZONE_ID and YOUR_API_TOKEN with your actual values.
To build DDNSGo from source, use the following command:
GOARCH=arm64 GOOS=linux CGO_ENABLED=0 go build .Adjust GOARCH and GOOS as needed for your target system.
To run DDNSGo as a systemd service, create a file named /etc/systemd/system/ddnsgo.service with the following content:
[Unit]
Description=Dynamic DNS Client
After=network.target
[Service]
ExecStart=/usr/local/bin/ddnsgo
Restart=always
RestartSec=60
User=YOURUSER
Group=YOURUSER
[Install]
WantedBy=multi-user.targetThen enable and start the service:
sudo systemctl enable ddnsgo
sudo systemctl start ddnsgoOnce configured and running, DDNSGo will periodically check your public IP address and update your DNS record if it has changed.
Contributions are welcome! Please feel free to submit a Pull Request.
GNU General Public License v3.0