Automatically update a DNS A record in Gandi LiveDNS whenever your computer's public IP address changes, detected automatically using a large, auto-updating pool of public STUN servers.
This is an alternative to filling out monthly CAPTCHAs for No-IP or paying for DynDNS, if you happen to already be paying for a domain name from the world's greatest domain registrar.
- .NET 8 Runtime or later
- Gandi domain name
- ✅ Domain must be using LiveDNS, the default for new domains (
ns-*-*.gandi.net) - ❌ Classic DNS (
*.dns.gandi.net) is incompatible; you will need to migrate 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
- ✅ Domain must be using LiveDNS, the default for new domains (
- Your computer or router must have a public WAN IPv4 address
- IPv6 is not supported at this time
- Download the latest release ZIP archive for your operating system and CPU architecture
- Extract the ZIP archive to a directory, such as
C:\Program Files\GandiDynamicDns\or/opt/gandidynamicdns/- Extract
appsettings.jsonduring a new installation, but not when upgrading an existing installation
- Extract
- Install the service
- Windows:
& '.\Install service.ps1' - Linux with systemd:
sudo cp gandidynamicdns.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable gandidynamicdns.service
- Windows:
This program is also available in a Docker container, created and maintained by Dommi.
- Follow the repo's container usage instructions to pull the image and mount your
appsettings.jsonfile
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. You can create a Personal Access Token for your user or for your organization. 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. 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.comexample.co.uk |
The second-level domain name that you registered, including the TLD. |
subdomains ✴ |
string[] |
["www"]["@"]["api.stage", "stage-api"] |
One or more subdomains whose DNS records you want to update, not including domain or a trailing period. To update domain itself, set this to ["@"] (default). Can also be multi-level subdomains. |
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 |
falsetrue |
Set to false (default) to run normally, or true to avoid changing any DNS records. |
unanimity |
uint32 |
15 |
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. |
- Manually:
./GandiDynamicDns - Windows service:
sc start GandiDynamicDns, or useservices.msc - Linux systemd service:
sudo systemctl start gandidynamicdns