Shell script and a SystemD timer to update DNS entries in OVH
Find a file
mkowalski 4783a28ad3 Made the script iterate over files in the WorkingDirectory, instead of just one env file, allowing the script to update hostnames for multiple credentials.
Changed the service file to allow it by removing the EnvironmentFile statement, and adding WorkingDirectory, set by default to "/etc/ovh-ddns.d/".
Version number up.
README updated.
2026-04-03 17:42:29 +02:00
ovh-ddns-update Made the script iterate over files in the WorkingDirectory, instead of just one env file, allowing the script to update hostnames for multiple credentials. 2026-04-03 17:42:29 +02:00
ovh-ddns-update.service Made the script iterate over files in the WorkingDirectory, instead of just one env file, allowing the script to update hostnames for multiple credentials. 2026-04-03 17:42:29 +02:00
ovh-ddns-update.timer Made the script iterate over files in the WorkingDirectory, instead of just one env file, allowing the script to update hostnames for multiple credentials. 2026-04-03 17:42:29 +02:00
ovh-ddns.conf Made the script iterate over files in the WorkingDirectory, instead of just one env file, allowing the script to update hostnames for multiple credentials. 2026-04-03 17:42:29 +02:00
README.md Made the script iterate over files in the WorkingDirectory, instead of just one env file, allowing the script to update hostnames for multiple credentials. 2026-04-03 17:42:29 +02:00

OVH DDNS update v1.1

Script for updating Dynamic DNS via OVH's DynHost. Includes a SystemD service file and a timer set to 5 minutes.

How it works:

The SystemD timer runs the service every 5 minutes.
Then the script updates the A record in OVH DynHost using the curl command,
with the public IPv4 taken from ipv4.icanhazip.com

Usage:

  • Place "ovh-ddns-update" in /usr/local/bin/
  • Make sure it's executable: chmod +x /usr/local/bin/ovh-ddns-update
  • Place the .service and .timer files in /etc/systemd/system/
  • Optional: Modify the .service or .timer files if you want to change the defaults like path to script, timer interval, or the drop-in directory
  • Copy the "ovh-ddns.conf" template file into /etc/ovh-ddns.d/. All files from there will be sourced and iterated over.
  • Edit it to include OVH DynHost credentials and hostnames created in OVH panel. You can have multiple credentials in separate files, with each file being able to include multiple hostnames to be updated if the given credentials in the file allow it.
  • Recommended: Run chmod 600 /etc/ovh-ddns.d/nameofyourfile for each env file in the directory, to secure them.
  • Start the timer and enable it on boot via `systemctl enable --now ovh-ddns-update.timer``