Production-Ready Dynamic DNS Client for OVH
An automated, lightweight, and fault-tolerant service to keep your OVH DNS Zone in sync with your public IP.
Built with Go for performance. Designed for Docker for simplicity.
This application runs as a background service to automatically detect Public IP changes and update your OVH DNS Zone "A" records accordingly. It is built with Go for performance and reliability, featuring IP provider redundancy and Docker support out of the box.
- Automated DNS Updates: Monitors public IP and updates OVH DNS records when a change is detected.
- Failover Redundancy: Queries multiple IP providers (
ipify,icanhazip,ifconfig.me) to ensure connectivity is always accurately verified. - IPv4 Forced: Ensures only valid IPv4 addresses are used for 'A' records, anticipating network stack preferences.
- Secure Authentication: Uses OVH native OAuth2 tokens (App Key/Secret & Consumer Key) instead of risky username/password storage.
- Subdomain Support: Works with specific subdomains (e.g.,
vpn.example.com) or root domains. - Docker Native: Includes optimized
Dockerfile(multi-stage build) anddocker-compose.ymlfor easy deployment. - Metrics & Logging: Provides clear logs and hourly metrics about successful updates and check status.
Before running the application, you need to generate API credentials from OVH.
- Go to the OVH Create Token page.
- Set the validity to "Unlimited".
- Grant the following permissions:
GET /domain/zone/*PUT /domain/zone/*POST /domain/zone/*
- Copy the
App Key,App Secret, andConsumer Key.
The easiest way to run the application is using Docker Compose.
-
Clone the repository:
git clone https://github.com/mateo08c/ovh-dyndns.git cd ovh-dyndns -
Configure Environment: Copy the example configuration file and fill in your credentials.
cp .env.example .env
Edit
.envwith your preferred editor and set your OVH keys and DNS settings. -
Start the Service:
docker-compose up -d
If you prefer to run the binary directly on your host machine.
We provide scripts to easily build for your platform.
Linux / macOS
./scripts/build.shWindows (PowerShell)
./scripts/build.ps1The compiled binary will be located in the build/ directory.
- Ensure your environments variables are set (or a
.envfile is present in the working directory). - Execute the binary:
./build/linux_amd64
The application is configured via environment variables.
| Variable | Description | Example |
|---|---|---|
OVH_ENDPOINT |
The OVH API endpoint (usually ovh-eu). |
ovh-eu |
OVH_APP_KEY |
Your Application Key. | xxxxxxxxxxxx |
OVH_APP_SECRET |
Your Application Secret. | xxxxxxxxxxxx |
OVH_CONSUMER_KEY |
Your Consumer Key. | xxxxxxxxxxxx |
DNS_ZONE |
The root domain zone managed in OVH. | example.com |
DNS_SUBDOMAIN |
The subdomain to update. (e.g., home, vpn). |
home |
CHECK_INTERVAL |
Time between IP checks (Go duration format). | 5m (5 minutes) |
.
├── cmd/
│ └── ovh-dyndns/ # Main application entry point
├── scripts/ # Build scripts for Windows and Linux
├── build/ # Output directory for binaries
├── Dockerfile # Multi-stage Docker build
├── docker-compose.yml # Container orchestration
└── go.mod # Go dependencies
Contributions are welcome! Please feel free to inspect the code, open issues for bugs, or submit pull requests for improvements.
This project is open-source and available under the MIT License.