Git Product home page Git Product logo

gandi-live-dns's Introduction

gandi-live-dns

This is a simple dynamic DNS updater for the Gandi registrar. It uses their LiveDNS REST API to update the zone file for a subdomain of a domain to point at the external IPv4 and IPv6 addresses of the computer it has been run from.

It found out public IPs using openDNS myip record

It requieres Python 2

With the new v5 Website, Gandi has also launched a new REST API which makes it easier to communicate via bash/curl or python/requests.

Configure

API Key

First, you must apply for an API key with Gandi. Visit https://account.gandi.net/en/ and apply for (at least) the production API key by following their directions.

A DNS Record

Create the DNS A and AAAA Records in the GANDI Webinterface which you want to update if your IP changes.

Script Configuration

Then you'd need to configure the script in the src directory. Copy example.config.py to config.py, and put it in the same directory as the script.

Edit the config file to fit your needs.

api_secret

Start by retrieving your API Key from the "Security" section in new Gandi Account admin panel to be able to make authenticated requests to the API. api_secret = '---my_secret_API_KEY----'

domain

Your domain for the subdomains to be updated

subdomains

All subdomains which should be updated. They get created if they do not yet exist.

subdomains = ["subdomain1", "subdomain2", "subdomain3"]

The first subdomain is used to find out the actual IP in the Zone Records.

Run the script

./gandi-live-dns.py -6 -v
Public ipv4 is 90.x.x.220
DNS ipv4 is 90.x.x.220
Public ipv6 is 2a01:cb19:x:x:216:6fff:fee4:8649
DNS ipv6 is 2a01:cb19:x:x:96de:80ff:fed7:6108
DNS record foo updated to 2a01:cb19:x:x:216:6fff:fee4:8649

Build archlinux package

cd package
makepkg .

Run with systemd

systemd start gandi-live-dns.service

Enable systemd timer

systemd enable gandi-live-dns.timer

gandi-live-dns's People

Contributors

cavebeat avatar exzz avatar

Stargazers

 avatar

Watchers

 avatar  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.