A lightweight DNS record updater that supports multiple DNS providers (DigitalOcean and Google Cloud Platform) to automatically update DNS records with your current public IP address.
- Supports multiple DNS providers:
- DigitalOcean DNS
- Google Cloud Platform DNS
- Automatic IP address detection
- Docker support with minimal secure image
- Configurable updates for multiple domains and records
- YAML-based configuration
Pull the latest version from GitHub Container Registry:
docker pull ghcr.io/orkarstoft/dns-updater:latest- Clone the repository:
git clone https://github.com/orkarstoft/dns-updater.git
cd dns-updater- Build the binary:
go build -o dnsupdater cmd/main.goCreate a config.yaml file with your DNS provider credentials and update configuration:
provider:
name: digitalocean
config:
token: <DO_TOKEN>
updates:
- domain: example.com
zone: example-com
type: A
records:
- "@" # Set the root level record, so example.com
- record1 # Set the subdomain record, so record1.example.comprovider:
name: googlecloudplatform
config:
credentialsFile: "/path/to/credentials.json"
projectId: "your-project-id"
updates:
- domain: example.com
zone: example-com
type: "A"
records:
- record1
- record2tracing:
enabled: true
host: dns-updater-jaeger-1 # This would be the hostname when running with docker compose
port: 4317
allowInsecure: truelog:
level: debug # info, warning, debug
type: pretty # json, pretty, file (app.log)docker run -v /path/to/config.yaml:/config.yaml ghcr.io/orkarstoft/dns-updater:latestFor GCP authentication, mount your credentials file:
docker run -v /path/to/config.yaml:/config.yaml \
-v /path/to/credentials.json:/credentials.json \
ghcr.io/orkarstoft/dns-updater:latest./dns-updater- Go 1.23 or higher
- Docker (for container builds)
Build the binary:
go build -o dnsupdater cmd/main.goBuild the Docker image:
docker build -t dns-updater .go test ./...- Fork the repository
- Create your feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add some amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
- The Docker image runs as a non-root user
- Credentials should be properly secured and never committed to version control
- For production use, store sensitive configuration in secure locations
This project is licensed under the MIT License - see the LICENSE file for details.
- Uses the godo client for DigitalOcean API
- Uses the Google Cloud DNS API for GCP integration