Coder Social home page Coder Social logo

gandi-dynamic-livedns's Introduction

livedns-updater.py - Gandi LiveDNS Updater 🐍

This python script allows the user to dynamically update a list of DNS records hosted by http://www.gandi.net.

The objective is to reproduce a dynamic DNS functionality, using Gandi’s newest LiveDNS RESTful API .

Installation and usage

Just clone the repository (or copy the script) and edit the config file.

Then run livedns-updater.py –c your_config.cfg

The script can be run at regular interval by adding it to your crontab:

*/15 * * * * python /path/to/livedns-updater.py -c your_config.cfg

Configuration

The configuration is made in an ini-like file:

[general]
api = https://dns.beta.gandi.net/api/v5/
api_key = YOUR_API_KEY

[example_test]
domain = example.com
name = test
type = A
ttl = 10800
value = EXTERNAL_IP

...

The [general] section contains settings that are common to all records:

  • api the LiveDNS API endpoint URL
  • api_key your personal API key, generated in your account page

Each subsequent section refers to a DNS record to be updated. The section title (in square brackets) is for your own information only, and is not used by the script. Name it however you want. It must contain the following keys:

  • domain the domain name
  • name the name of the record
  • type the type of record
  • ttl the TTL associated with that record (in seconds)

ℹ️ Please note that the example file also contains a value line, but it is not used currently, all records are updated with the external IP address.

If a record requires a specific API key, it can be set by adding an api_key in the record section.

Motivation

This project was started as a hobby project, adapting existing scripts to my needs and coding habits. I wanted to rely only on the python standard library, hence the use of urllib instead of python-requests.

Credits

This project was inspired by similar projects, mostly:

License

This project is licensed under the terms of the MIT license.

gandi-dynamic-livedns's People

Contributors

plut0nium avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.