GithubHelp home page GithubHelp logo

kay0u / hdyndns Goto Github PK

View Code? Open in Web Editor NEW

This project forked from decentral1se/hdyndns

0.0 1.0 0.0 38 KB

A GNU/Linux Python 3.5+ DynDNS client for your homebrew server.

License: GNU Affero General Public License v3.0

Makefile 0.79% Python 99.21%

hdyndns's Introduction

hdyndns

A GNU/Linux Python 3.5+ Dynamic DNS client for your homebrew server.

When To Use It

From Access Your Home Network From Anywhere With Dynamic DNS:

A Local Update Client

If your router doesn’t support DDNS services, you will need a local client to run on a frequently used computer somewhere on your home network. This lightweight little application will check what your IP address is and then phone home to the DDNS provider to update your DDNS record. It’s less ideal than a router-based solution–if the computer isn’t on when your IP address changes, then the record doesn’t get updated–but it’s certainly better than manually editing your DDNS entry.

This tool is the 'Local Update Client' component of the Dynamic DNS hombrew setup.

Why To Use It

  • Lightweight with no external Python dependencies.
  • Simple 'ini style' configuration.
  • Avoid writing hard to maintain Dynamic DNS bash scripts.
  • Small code base, easy to understand, maintain and extend and is cross platform.
  • Will be maintained going forward and is being used in existing homebrew setups.

How To Use It

The following examples were run on a Debian system using the Gandi DNS provider.

Make sure you have the necessary system prerequisites with:

$ sudo apt update
$ sudo apt install -y python3 python3-dev python3-pip

And then install hdyndns with:

$ sudo useradd -m hdyndns
$ sudo -u hdyndns pip3 install --user hdyndns

If you have an DNS A record for mysite.com and subdomains foo.mysite.com and bar.mysite.come that looks like the following:

@   1800 IN A 86.91.199.200
foo 1800 IN A 86.91.199.200
bar 1800 IN A 86.91.199.200

Then create a configuration file at /home/hdyndns/.hdyndns/hdyndns.ini:

[mysite.com]
provider = gandi
api_secret = mySuperSecretApiPassword
subdomains = foo,bar

Finally, add it your root crontab (sudo crontab -e) to run it every 15 minutes:

*/15 * * * * runuser -l hdyndns -c '$HOME/.local/bin/hdyndns' &>/dev/null

Regarding the &>/dev/null part, see issue #1.

Known Limitations

  • Different IP addresses for subdomains are currently not supported.

Please open an issue if you want to collaborate on removing these limitations.

Supported DNS Providers

Any DNS provider can be supported if they provide some programmatic way to update their DNS records (for example, if they have a public API). If your current DNS provider is not listed above, please raise an issue. If you'd like to add it yourself, take a look at hdyndns/providers.py. All contributions welcome!

Configuration Options

  • provider: The DNS provider.
  • api_secret: The API secret for the DNS provider.
  • subdomains: Optional comma separated list of subdomains to also update DNS entries for.
  • ttl: The DNS time to live counter in secods. Default is 1800.

How To Help

You'll need to install pipenv for development.

You can follow these steps to get a working local installation:

$ pipenv install --dev  # install the dependencies
$ pipenv run pip install -e .  # install the local hdyndns
$ pipenv run hdyndns --help  # check that the local hdynds is working
$ pipenv run tox -e py37  # run the tests on python 3.7 (run `tox -l` to see pythons)

Mirroring

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.