Code Monkey home page Code Monkey logo

gandi-ddns's Introduction

gandi-ddns

A dependency-less script for declarative dynamic DNS using the gandi.net API.

Requires: Python 3.10+

Example configuration

The following locations will be searched for a configuration file (or you can specify the --conf argument):

  • environment variable GANDI_DDNS_CONFIG
  • ~/.config/gandi-ddns.ini
  • /etc/gandi-ddns/config.ini
[default]

# Required

wan_device = enp2s0
gandi_api_key = $GANDI_API_KEY

# Optional; called when record changes happen or fail. Takes a single arg, a string
# message. I use pushover.net for this.
notify_script = /usr/local/bin/pushover 

# Each domain has its own section. Within each section, the format is
#
#  [record type], [record name] = [record value], ...
#

[foobar.org]

# blank value will be filled in with running host's IP.
A, @
A, mail
CNAME, bmon = some-host.lan.

# values are CSVs for separate records with the same name.
MX, @ = 10 one-val.com., 20 other-val.com.

[hmmmm.com]

A, @

Environment variables

  • GANDI_APIKEY: API key for gandi.net
  • GANDI_DDNS_CONFIG: path to configuration file

Install

% curl $this_url/main.py > ~/.local/bin/gandi-ddns  # or wherever
% chmod +x ~/.local/bin/gandi-ddns

% $EDITOR ~/.config/gandi-ddns.conf

% gandi-ddns

Run it on a crontab if you want:

% cat /etc/cron.d/gandi-ddns

*/15 * * * * your-user /home/your-user/.local/bin/gandi-ddns

gandi-ddns's People

Contributors

jamesob avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

tomlaco haplo

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.