https://github.com/aldaviva/gandidynamicdns
🏷️ Keep a Gandi DNS A record updated with your computer's public IP address
https://github.com/aldaviva/gandidynamicdns
dns dynamic-dns dynamic-dns-updater gandi gandi-dns gandi-livedns gandi-livedns-updater
Last synced: 27 days ago
JSON representation
🏷️ Keep a Gandi DNS A record updated with your computer's public IP address
- Host: GitHub
- URL: https://github.com/aldaviva/gandidynamicdns
- Owner: Aldaviva
- License: apache-2.0
- Created: 2024-06-10T08:27:21.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-03-22T03:53:27.000Z (about 1 month ago)
- Last Synced: 2025-03-24T07:08:32.952Z (about 1 month ago)
- Topics: dns, dynamic-dns, dynamic-dns-updater, gandi, gandi-dns, gandi-livedns, gandi-livedns-updater
- Language: C#
- Homepage:
- Size: 157 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License.txt
Awesome Lists containing this project
README
GandiDynamicDns
===[](https://github.com/Aldaviva/GandiDynamicDns/actions/workflows/dotnet.yml) [](https://aldaviva.testspace.com/spaces/277280) [](https://coveralls.io/github/Aldaviva/GandiDynamicDns?branch=master)
Automatically update a DNS `A` record in [Gandi](https://www.gandi.net) [LiveDNS](https://www.gandi.net/en-US/domain/dns) whenever your computer's public IP address changes, detected automatically using a [large, auto-updating pool](https://github.com/pradt2/always-online-stun) of public [STUN](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Protocols#stun) servers.
This is an alternative to filling out monthly CAPTCHAs for [No-IP](https://www.noip.com) or paying for [DynDNS](https://account.dyn.com), if you happen to already be paying for a domain name from the world's greatest domain registrar.
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Configuration](#configuration)
- [Execution](#execution)## Prerequisites
- [.NET 8 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later
- [Gandi domain name](https://www.gandi.net/en-US/domain)
- ✅ Domain must be using [LiveDNS](https://www.gandi.net/en-US/domain/dns), the default for new domains (`ns-*-*.gandi.net`)
- ❌ Classic DNS (`*.dns.gandi.net`) is incompatible; you will need to [migrate to LiveDNS](https://docs.gandi.net/en/domain_names/common_operations/changing_nameservers.html#switching-to-livedns)
- ❌ External nameservers (with glue records) are incompatible; you will need to update the record on the external nameserver instead of on Gandi's nameservers
- Your computer or router must have a public WAN IPv4 address
- IPv6 is not supported at this time## Installation
### Executable
1. Download the [latest release](https://github.com/Aldaviva/GandiDynamicDns/releases/latest) ZIP archive for your operating system and CPU architecture
1. Extract the ZIP archive to a directory, such as `C:\Program Files\GandiDynamicDns\` or `/opt/gandidynamicdns/`
- Extract `appsettings.json` during a new installation, but not when upgrading an existing installation
1. Install the service
- Windows: `& '.\Install service.ps1'`
- Linux with systemd:
```sh
sudo cp gandidynamicdns.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable gandidynamicdns.service
```### Container
This program is also available in [a Docker container](https://hub.docker.com/r/d0mmi/gandidynamicdns), created and maintained by [Dommi](https://github.com/d0mmi).
1. Follow the [repo's container usage instructions](https://github.com/d0mmi/GandiDynamicDnsDocker#usage) to pull the image and mount your `appsettings.json` file## Configuration
Open `appsettings.json` in a text editor and fill in the following values. Keys marked with ✴ are the most important ones to configure.|Key|Type|Examples|Description|
|-|-|-|-|
|`gandiAuthToken` ✴|`string`|`b03d46cd5af9e827fde09eb3b880e468b4e6dbeb` `Ln5yfyRCnNDSxQnWAFn5Zdyi`|A [Gandi Personal Access Token or API Key](https://api.gandi.net/docs/authentication/).
You can [create a Personal Access Token for your user](https://admin.gandi.net/organizations/account/pat) or [for your organization](https://admin.gandi.net/organizations/). The token must be scoped to include the `domain` to be updated, and must have permissions to "Manage domain name technical configurations." Make sure to set a calendar reminder for when this token expires, so you can generate a new token and update this configuration!
If you don't already have an API Key, it's too late to create one. If you forgot your existing API Key, you may regenerate it in [Developer access](https://account.gandi.net/en/users/_/security).
You can edit this property and save `appsettings.json`, and the new token will take effect immediately without you having to restart this program.|
|`domain` ✴|`string`|`example.com`
`example.co.uk`|The second-level domain name that you registered, including the TLD.|
|`subdomain` ✴|`string`|`www`
`@`
`api.stage`|The subdomain whose DNS record you want to update, not including `domain` or a trailing period. To update `domain` itself, set this to `@` (default). Can also be a multi-level subdomain.|
|`updateInterval`|`TimeSpan`|`0.00:05:00`|How frequently this program will check if your public IP address has changed and update DNS. Format is `d.hh:mm:ss`. Defaults to 5 minutes.
**One-shot mode:** if set to `0:0:0` or negative, this program will exit after the first update attempt, instead of remaining running and updating periodically; useful for custom triggers, like `cron` or systemd timers.|
|`dnsRecordTimeToLive`|`TimeSpan`|`0.00:05:00`|How long DNS resolvers can cache your record before they must look it up again. Format is `d.hh:mm:ss`. Gandi requires this to be between 5 minutes and 30 days, inclusive. Defaults to 5 minutes.|
|`dryRun`|`bool`|`false`
`true`|Set to `false` (default) to run normally, or `true` to avoid changing any DNS records.|
|`unanimity`|`uint32`|`1`
`5`|This many STUN servers must all agree on a new IP address in order to change the DNS record, otherwise it will be left unchanged. Defaults to `1` to only send a single request and use any valid public address, without confirming with other servers.|
|`stunServerBlacklist`|`string[]`|`["stun.bergophor.de", "stun.usfamily.net", "stun.finsterwalder.com"]`|List of STUN server hostnames to not use when determining your computer's public IP address. Defaults to blocking servers known to return incorrect responses.|## Execution
- **Manually**: `./GandiDynamicDns`
- **Windows service**: `sc start GandiDynamicDns`, or use `services.msc`
- **Linux systemd service**: `sudo systemctl start gandidynamicdns`