DeepThought .sh

Dynago

dynago is a cross-platform, resource-light dynamic DNS updater written in Go. It automatically updates DNS records with your current public IP address, ensuring your domain always points to your home, server, or cloud instance, even when your IP changes.

Go DNS Networking

Project Information

Stars 5
Language Go
License Other
Updated June 9, 2025

GPLv3 License Static Analysis: A+

dynago is a cross-platform, resource-light dynamic DNS updater written in Go. It automatically updates DNS records with your current public IP address, ensuring your domain always points to your home, server, or cloud instance, even when your IP changes.

Features

  • Supports multiple DNS providers:
    • Cloudflare (with support for the "proxied" flag)
    • AWS Route53
  • Efficient: Only updates DNS records if your public IP has changed.
  • Configurable: YAML-based configuration for update interval, IP source, logging, and provider-specific options.
  • Robust logging: Pretty console output and file logging with log levels.
  • Production-ready: Systemd service and Makefile for easy deployment.
  • Tested: All modules have unit tests and detailed GoDoc comments.

Providers Supported

  • Cloudflare
    • Supports A/AAAA records
    • Uses API token authentication
    • Respects the proxied flag (orange cloud)
  • AWS Route53
    • Supports A/AAAA records
    • Uses static credentials (access key/secret)

How It Works

  1. Periodically fetches your current public IP from a configurable source (e.g., https://api.ipify.org).
  2. Checks the configured DNS record(s) at your provider(s).
  3. If the DNS record does not match your current IP, updates it via the provider's API.
  4. Logs all actions and errors.

Quick Start

1. Build

make

This builds the dynago binary to bin/dynago.

2. Configure

Copy the example config and edit as needed:

sudo mkdir -p /etc/dynago
sudo cp configs/dynago.yml /etc/dynago/dynago.yml

Edit /etc/dynago/dynago.yml with your provider credentials and desired settings.

3. Install

sudo make install

This will:

  • Install the binary to /usr/local/bin/dynago
  • Install the config to /etc/dynago/dynago.yml
  • Install the systemd service to /etc/systemd/system/dynago.service
  • Enable the service (but not start it)

4. Start the Service

sudo systemctl daemon-reload
sudo systemctl start dynago
sudo systemctl status dynago

5. Logs

By default, logs are printed to the console and can be viewed with:

sudo journalctl -u dynago -f

Windows

  1. Build:

    go build -o dynago.exe ./cmd/dynago
  2. Configure:

    mkdir C:\ProgramData\dynago

copy configs\dynago.yml C:\ProgramData\dynago\dynago.yml Edit C:\ProgramData\dynago\dynago.yml with your provider credentials and desired settings.

  1. Run manually:

    dynago.exe -config C:\ProgramData\dynago\dynago.yml
  2. (Optional) Install as a service:

    • Download and install NSSM.
    • Run:
      nssm install dynago "C:\path\to\dynago.exe" -config "C:\ProgramData\dynago\dynago.yml"

nssm start dynago

  1. Logs:
    • Use the -log flag to specify a log file, e.g. -log C:\ProgramData\dynago\dynago.log.

Configuration

Edit /etc/dynago/dynago.yml to set your update interval, IP source, log level, and provider credentials. Example:

interval: 5m
ip_source: "https://api.ipify.org"
log_level: "info"
providers:
  cloudflare:
    enabled: true
    api_token: "your-cloudflare-api-token"
    zone_id: "your-zone-id"
    record_name: "home.example.com"
    record_type: "A"
    proxied: true
  route53:
    enabled: false
    access_key_id: "AWS_ACCESS_KEY_ID"
    secret_access_key: "AWS_SECRET_ACCESS_KEY"
    hosted_zone_id: "Z1D633PJN98FT9"
    record_name: "home.example.com"
    record_type: "A"
    region: "us-east-1"
  • Set enabled: true for the provider(s) you want to use.
  • For Cloudflare, set proxied: true to enable the orange cloud (proxy).

Provider Configuration

Each provider’s configuration is defined by that provider’s Go package. The main config file’s providers: section is a map, and each provider receives its own sub-map at runtime.

For example, the Cloudflare provider expects:

providers:
  cloudflare:
    enabled: true
    api_token: "your-cloudflare-api-token"
    zone_id: "your-zone-id"
    record_name: "home.example.com"
    record_type: "A"
    proxied: true

The Route53 provider expects:

providers:
  route53:
    enabled: false
    access_key_id: "AWS_ACCESS_KEY_ID"
    secret_access_key: "AWS_SECRET_ACCESS_KEY"
    hosted_zone_id: "Z1D633PJN98FT9"
    record_name: "home.example.com"
    record_type: "A"
    region: "us-east-1"

To add a new provider:

  • Implement the DNSProvider interface in your own package.
  • Define your own config struct and document the expected YAML.
  • Unmarshal the config using the provided config.ConfigFromMap helper.

Advanced

  • Run manually:
    ./bin/dynago -config=configs/dynago.yml
  • Change log file:
    ./bin/dynago -config=configs/dynago.yml -log=/var/log/dynago.log
  • Test:
    go test ./...

Security

  • Store your API tokens and credentials securely.
  • The config file should be readable only by the user running dynago.

Contributing

Pull requests and issues are welcome! Please add tests and GoDoc comments for new features.

License

This project is licensed under the GNU General Public License v3.0. See LICENSE for details.

Images are automatically mirrored

Images from the GitHub repository are downloaded and hosted locally to ensure they load properly.