Industrial-strength dynamic DNS client
Project description
MCDDNS
Mike Conigliaro's industrial-strength Dynamic Domain Name System client
Features
- Extensible plugin-oriented architecture with a simple API
- Address providers are responsible for obtaining an address
- DNS providers are responsible for managing a DNS record
- Built-in result validation for address providers (guards against problematic endpoints)
- Use multiple address providers (keep trying until one succeeds)
- Optional retry with Fibonacci backoff
- Detailed logging
- Dry-run mode (shows what will happen without changing anything)
- Cron mode (prevents email flood if your Internet connections goes down)
Built-In Providers
Address Providers
aws.CheckIP: Obtains a public IPv4 address via Amazon Web Servicesdyn.CheckIP: Obtains a public IPv4 address via Dyngoogle.CheckIP: Obtains a public IPv4 address via Google Domainsipify.IPv4: Obtains a public IPv4 address via ipifyipify.IPv6: Obtains an IPv6 address via ipify
DNS Providers
aws.Route53: Manages records in Amazon Route53
Installation
pip install mcddns
Running the Application
mcddns <dns_provider> <fqdn> [options]
Use --help to see available options.
Development
Getting Started
pip install pipenv
pipenv install --dev
pipenv shell
...
Running Tests
pytest
Writing Providers
A provider is any class that inherits from AddressProvider or DNSProvider. In production mode, Python modules/packages prefixed with mcddns_ will automatically be imported from the following locations:
$XDG_CONFIG_HOME/mcddns/providers/etc/mcddns/providers- sys.path
Example: If you create a file at $XDG_CONFIG_HOME/mcddns/providers/mcddns_foo.py with a class named Bar that inherits from one of the Provider subclasses, your module can be referenced (e.g. in command-line options) as foo.Bar.
Provider Methods
Each provider type has a set of methods that will be called in a particular order. Note that some of these methods are expected to return a specific value in order to progress to the next step.
All Providers
options_pre(parser): Runs before option parsing. Use this method to add your own provider-specific command line arguments (See: argparse).options_post(parser, options): Runs after option parsing. Use this method to do things with your provider-specific command line arguments.
Address Providers
fetch(options): Fetches and returns an IP address, hostname, etc.validate(options, address): ReturnsTrueif the address is valid andFalseotherwise
DNS Providers
check(options, address): ReturnsTrueif a DNS update is required andFalseotherwiseupdate(options, address): ReturnsTrueif a DNS update was successful andFalseotherwise
Examples
I'll write more documentation if people are interested, but for now, see the examples at mcddns/providers and tests/providers.
Releases
- Bump
VERSIONin mcddns/meta.py - Update CHANGELOG.md
- Run
make release
To Do
- Add tests for built-in providers
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcddns-1.0.0.tar.gz.
File metadata
- Download URL: mcddns-1.0.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab26ac6f7fad516f8bcddc033a51c9cad889ce3d1fec4ba03c7a1d923979899f
|
|
| MD5 |
37daa6e6df8d86ca57fb76c050b1e38d
|
|
| BLAKE2b-256 |
9e4dc8bacdb9087a2e5ab29e70cebaf2e25a65ed407fcdb64344188ba403deca
|
File details
Details for the file mcddns-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcddns-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9863580296776411146909843ffbcb01b601cc42c861251a2cbb86e70140dc7d
|
|
| MD5 |
270a2d5292ab6692b6a30b7b2ad660fd
|
|
| BLAKE2b-256 |
947138007fffd77579bb82d0883563ed5a144a7d0878fdcc428b1d5fa7cf3341
|