Mike Conigliaro's industrial-strength Dynamic Domain Name System client
- 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
- Resilient against network and endpoint failures
- Built-in result validation for address providers
- Use multiple address providers (keep trying until one succeeds)
- Optional retry with Fibonacci backoff
- Cron mode (prevents email flood if your Internet connections goes down)
- Detailed logging
- Dry-run mode (shows what will happen without changing anything)
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
aws.Route53: Manages records in Amazon Route53
pip install mcddns
mcddns <dns_provider> <fqdn> [options]
Use --help to see available options.
poetry install
poetry shell
...
pytest
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/provider/etc/mcddns/provider- sys.path
Example: If you create a file at $XDG_CONFIG_HOME/mcddns/provider/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.
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.
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.
fetch(options): Fetches and returns an IP address, hostname, etc.validate(options, address): ReturnsTrueif the address is valid andFalseotherwise
check(options, address): ReturnsTrueif a DNS update is required andFalseotherwiseupdate(options, address): ReturnsTrueif a DNS update was successful andFalseotherwise
I'll write more documentation if people are interested, but for now, see the examples at mcddns/provider and tests/provider.
- Bump
versionin pyproject.toml - Update CHANGELOG.md
- Run
make release
- Add tests for built-in providers