dyndns package

Module contents

Set version.

Submodules

dyndns.cli module

Command line interface for the command dyndns-debug

dyndns.cli.get_argparser()[source]
dyndns.cli.main()[source]

dyndns.config module

Load and validate the configuration.

dyndns.config.get_config(config_file=None)[source]
dyndns.config.load_config(config_file=None)[source]
dyndns.config.validate_config(config=None)[source]
dyndns.config.validate_secret(secret)[source]

dyndns.dns_updates module

Interface for DNS updates.

dyndns.dns_updates.authenticate(secret, config)[source]
dyndns.dns_updates.catch_errors(function, **kwargs)[source]
dyndns.dns_updates.delete_dns_record(secret=None, fqdn=None, config=None)[source]
dyndns.dns_updates.raise_parameter_error(function, exception, *args, **kwargs)[source]
dyndns.dns_updates.update_dns_record(secret=None, fqdn=None, zone_name=None, record_name=None, ip_1=None, ip_2=None, ipv4=None, ipv6=None, ttl=None, config=None)[source]

Update a DNS record.

Parameters
  • secret (str) – A password like secret string. The secret string has to be at least 8 characters long and only alphnumeric characters are allowed.

  • fqdn (str) – The Fully-Qualified Domain Name (e. g. www.example.com). If you specify the argument fqdn, you don’t have to specify the arguments zone_name and record_name.

  • zone_name (str) – The zone name (e. g. example.com). You have to specify the argument record_name.

  • record_name (str) – The record name (e. g. www). You have to specify the argument zone_name.

  • ip_1 (str) – A IP address, can be version 4 or version 6.

  • ip_2 (str) – A second IP address, can be version 4 or version 6. Must be a different version than ip_1.

  • ipv4 (str) – A IP address version 4.

  • ipv6 (str) – A IP address version 6.

  • ttl (int) – Time to live.

  • config (dict) – The configuration in the Python dictionary format (as returned by the function validate_config()).

dyndns.dns module

Query the DSN server using the package “dnspython”.

class dyndns.dns.DnsUpdate(nameserver, names, ipaddresses=None, ttl=None)[source]

Bases: object

Update the DNS server

delete()[source]
nameserver

The nameserver

update()[source]

dyndns.exceptions module

A collection of exceptions.

exception dyndns.exceptions.ConfigurationError[source]

Bases: DyndnsError

dyndns configuration error.

exception dyndns.exceptions.DNSServerError[source]

Bases: DyndnsError

Communicating with the external DNS server.

exception dyndns.exceptions.DyndnsError[source]

Bases: Exception

Base exception of the package dyndns.

exception dyndns.exceptions.IpAddressesError[source]

Bases: DyndnsError

This error gets thrown by invalid IP addresses.

exception dyndns.exceptions.NamesError[source]

Bases: DyndnsError

This error gets thrown by invalid DNS names.

exception dyndns.exceptions.ParameterError[source]

Bases: DyndnsError

Client side parameter error.

dyndns.html_template module

A collection of HTML template functions.

class dyndns.html_template.RestructuredText[source]

Bases: object

static read(file_name)[source]
static read_to_html(file_name, remove_heading=False)[source]
static remove_heading(restructured_text)[source]
static to_html(restructured_text, remove_heading=False)[source]
dyndns.html_template.template_base(title, content)[source]
dyndns.html_template.template_usage(remove_heading=False)[source]

dyndns.ipaddresses module

Deal with ipv4 and ipv6 IP addresses.

class dyndns.ipaddresses.IpAddressContainer(ip_1=None, ip_2=None, ipv4=None, ipv6=None, request=None)[source]

Bases: object

A container class to store and detect IP addresses in both versions (ipv4 and ipv6).

Parameters
  • ip_1 (str) – Am IP address of unkown version.

  • ip_2 (str) – An IP address of unkown version.

  • ipv4 (str) – An ipv4 IP address.

  • ipv6 (str) – An ipv6 IP address.

ipv4

The ipv4 address to update the DNS record with.

ipv6

The ipv6 address to update the DNS record with.

dyndns.ipaddresses.format_attr(ip_version)[source]
dyndns.ipaddresses.validate(address, ip_version=None)[source]

dyndns.log module

Bundle the logging functionality.

class dyndns.log.DateTime(date_time_string=None)[source]

Bases: object

iso8601()[source]
iso8601_short()[source]
class dyndns.log.Message[source]

Bases: object

log_levels = {'CONFIGURATION_ERROR': 51, 'DNS_SERVER_ERROR': 51, 'PARAMETER_ERROR': 41, 'UNCHANGED': 11, 'UPDATED': 21}
message(msg, log_level)[source]
class dyndns.log.UpdatesDB[source]

Bases: object

get_fqdns()[source]
get_updates_by_fqdn(fqdn)[source]
log_update(updated, fqdn, record_type, ip)[source]
static normalize_row(row)[source]
dyndns.log.msg(msg, log_level)

dyndns.names module

Deal with different kind of names (FQDNs (Fully Qualified Domain Names), record and zone names)

record_name + zone_name = fqdn

class dyndns.names.Names(zones, fqdn=None, zone_name=None, record_name=None)[source]

Bases: object

fqdn

The Fully Qualified Domain Name (e. g. www.example.com.)

record_name

The name resource record (e. g. www.)

tsig_key

The twig key (e. g. tPyvZA==)

zone_name

The zone name (e. g. example.com.)

class dyndns.names.Zone(zone_name, tsig_key)[source]

Bases: object

build_fqdn(record_name)[source]
split_fqdn(fqdn)[source]

Split hostname into record_name and zone_name for example: www.example.com -> www. example.com.

class dyndns.names.Zones(zones_config)[source]

Bases: object

get_zone_by_name(zone_name)[source]
split_fqdn(fqdn)[source]

Split hostname into record_name and zone_name for example: www.example.com -> www. example.com.

dyndns.names.validate_hostname(hostname)[source]
dyndns.names.validate_tsig_key(tsig_key)[source]

dyndns.webapp module

Initialize the Flask app.

dyndns.webapp.about()[source]
dyndns.webapp.delete_by_path(secret, fqdn, ip_1=None, ip_2=None)[source]
dyndns.webapp.docs_configuration()[source]
dyndns.webapp.docs_installation()[source]
dyndns.webapp.docs_usage()[source]
dyndns.webapp.home()[source]
dyndns.webapp.statistics_latest_submissions()[source]
dyndns.webapp.statistics_updates_by_fqdn()[source]
dyndns.webapp.update_by_path(secret, fqdn, ip_1=None, ip_2=None)[source]
dyndns.webapp.update_by_query_string()[source]