Package: ws.ddns
This packages provides a way to update DNS records programmatically,
for customers ofSchlundtech, using theirXML-Gateway.Many thanks tohttps://github.com/martinlowinski/php-dyndnsfor doing the heavy
lifting of figuring out how to talk to the XML-Gateway in a way that actually
makes it do what we want.UsageFirst, you need to create a subdomain with an A-record in your domain, sayhome.example.com,
and install this package, e.g. withpip install ws.ddns(orgit clone...;pip install-e.)Then you can use the command-line utility provided by this package, like so:$ schlund-ddns --username USER --password PASS home.example.com 1.2.3.4If you have both an A and AAAA record for the subdomain, you have to update them separately,
i.e. call the script twice, once with an IPv4 and a second time with IPv6 address.(Seeschlund-ddns--helpfor more configuration parameters, e.g. thecontextthat you were told to use when applying for the XML-Gateway.)Instead of passing the parameters on the commandline, you can instead callschlund-ddns--configmyconfig.ini(see below for the file format).Alternatively, set up the provided cgi scriptschlund-ddns-cgito provide
HTTP access. You’ll need to provide username and password using a configuration
file and then passing that file’s path as an environment variable. Here’s an
example apache configuration snippet to do this:ScriptAlias /dns-update /path/to/ddns/schlund-ddns-cgi
<Location /dns-update>
  SetEnv DDNS_CONFIG /path/to/ddns/config

  AuthName "Dynamic DNS"
  AuthType Basic
  AuthUserFile /path/to/ddns/htpasswd
  require valid-user
</Location>The configuration file is a standard ini file and should look like this:[default]
username = USER
password = PASS
context  = CONTEXTYou can optionally add anallowed_hostnames = one.example.com two.example.comwhitespace-separated list to the config file, only those will then be accepted.The HTTP protocol is modeled after the one fromNoIP, that is, clients
should perform a request like this to trigger a DNS update:http://example.com/dns-update?hostname=home.example.com&myip=1.2.3.4There is also a docker image of the HTTP service here:https://hub.docker.com/r/customelements/schlund-ddns2FA supportInstallpip install pyotpin addition to this packagePass the 2FA secret (probably 16 characters, you may have to reverse-engineer them from the QR-Code used for setup) as–totp-secret`commandline or configuration parameterCHANGES1.6.0 (2024-02-05)ChangesSupport TOTP in CGI mode as well (totp)1.5.0 (2023-09-18)ChangesSupport subdomains with both A and AAAA records (ipv6)1.4.0 (2023-05-12)ChangesFix config parsing after introducing totp secret parameter (totp)1.3.1 (2023-04-04)ChangesSwitch from setup.py to pyproject.toml (wheel)1.3.0 (2023-03-20)Support a configuration file for the command line scriptDetermine the domain name correctly for multi-level subdomainsSupport 2FA TOTP authenticationDrop Python-2 support1.2.0 (2020-10-04)Model our response text after the noip.com protocol1.1.1 (2018-03-05)HandlePATH_INFOinternally1.1.0 (2018-03-03)Add optionalallowed_hostnamesconfig option1.0.4 (2018-03-03)Make web part Python-3 compatible1.0.3 (2018-03-03)Make current-setuptools compatible1.0.2 (2018-03-03)Make Python-3 compatible1.0.1 (2018-01-14)Move from bitbucket to github1.0.0 (2014-04-06)First release.