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.go
Create a config.yaml
file with your DNS provider credentials and update configuration:
doToken: "your-digitalocean-api-token"
updates:
- domain: "example.com"
zone: "example.com"
records:
- "www"
- "@"
type: "A"
gcp:
credentialsFile: "/path/to/credentials.json"
projectId: "your-project-id"
updates:
- domain: "example.com"
zone: "example-com"
records:
- "www"
- "@"
type: "A"
docker run -v /path/to/config.yaml:/config.yaml ghcr.io/orkarstoft/dns-updater:latest
For 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.go
Build 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