Gandi domain updater script for dynamic IP addresses.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 15 commits behind Chralu:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Your server has a dynamic IP address and you use Gandi as domain name server ? Then Gandyn is for you !

This is an unsecure script based on Comète's work. It uses Gandi XML-RPC service to update your DNS record. Server public IP address is retrieved from

As this is my first python "project", code might not be very pythonic. So, feel free to improve it :)


First of all you have to enable XML-RPC interface for your domain on Gandi web interface. Gandi will then give you an API key. Copy paste it to your gandyn config file.


Archlinux users :

There is a 'gandyn' package in AUR.

Others :

The python standard way works.

$ wget -O gandyn.tar.gz<version>
$ tar xvzf gandyn.tar.gz
$ cd gandyn/src/
# python install


Gandyn gets its configuration from a simple python file. Config file syntax is described later. To run Gandyn, use the command : --config <path to the config file>

To get Gandyn run every 5 minutes, add the following line to your crontab.

*/5 * * * * --config <path to the config file> 


Configuration file is a simple python script that defines global constants.

This is unsecure, so it is important that nobody can change the config file content.

Here is a basic config file with default values :

#API key generated by Gandi
API_KEY = '' 

#Name of the domain to update

#Time to live of the updated record
TTL = 300

#Filters used to find the record to update.
#By default, the updated record is "@   A"
#Where '' is the updated value
RECORD = {'type':'A', 'name':'@'}

#Log level of the script. Values are :
#   logging.DEBUG
#   logging.INFO
#   logging.WARNING
#   logging.ERROR
#   logging.CRITICAL

#Path of the log file
LOG_FILE = 'gandyn.log'