API Documentation¶
This part of the documentation should cover all the relevant interfaces of dyndnsc.
Main Interface¶
-
class
dyndnsc.
DynDnsClient
(updater=None, detector=None, plugins=None, detect_interval=300)[source]¶ This class represents a client to the dynamic dns service.
Initialize.
- Parameters
detect_interval – amount of time in seconds that can elapse between checks
-
check
()[source]¶ Check if the detector changed and call sync() accordingly.
If the sleep time has elapsed, this method will see if the attached detector has had a state change and call sync() accordingly.
-
has_state_changed
()[source]¶ Detect changes in offline detector and real DNS value.
Detect a change either in the offline detector or a difference between the real DNS value and what the online detector last got. This is efficient, since it only generates minimal dns traffic for online detectors and no traffic at all for offline detectors.
- Return type
boolean
-
needs_check
()[source]¶ Check if enough time has elapsed to perform a check().
If this time has elapsed, a state change check through has_state_changed() should be performed and eventually a sync().
- Return type
boolean
IP Updaters¶
Afraid¶
Functionality for interacting with a service compatible with https://freedns.afraid.org/.
Duckdns¶
Module containing the logic for updating DNS records using the duckdns protocol.
From the duckdns.org website:
https://{DOMAIN}/update?domains={DOMAINLIST}&token={TOKEN}&ip={IP}
- where:
DOMAIN the service domain DOMAINLIST is either a single domain or a comma separated list of domains TOKEN is the API token for authentication/authorization IP is either the IP or blank for auto-detection
Dyndns2¶
Module providing functionality to interact with dyndns2 compatible services.
IP Detectors¶
Command¶
Module containing logic for command based detectors.
DNS WAN IP¶
Module containing logic for DNS WAN IP detection.
See also https://www.cyberciti.biz/faq/how-to-find-my-public-ip-address-from-command-line-on-a-linux/
Interface¶
Module providing IP detection functionality based on netifaces.
-
class
dyndnsc.detector.iface.
IPDetector_Iface
(iface=None, netmask=None, family=None, *args, **kwargs)[source]¶ IPDetector to detect an IP address assigned to a local interface.
This is roughly equivalent to using ifconfig or ipconfig.
Initialize.
- Parameters
iface – name of interface
family – IP address family (default: INET, possible: INET6)
netmask – netmask to be matched if multiple IPs on interface (default: none (match all)”, example for teredo: “2001:0000::/32”)
-
__init__
(iface=None, netmask=None, family=None, *args, **kwargs)[source]¶ Initialize.
- Parameters
iface – name of interface
family – IP address family (default: INET, possible: INET6)
netmask – netmask to be matched if multiple IPs on interface (default: none (match all)”, example for teredo: “2001:0000::/32”)
Socket¶
Module containing logic for socket based detectors.
Teredo¶
Module containing logic for teredo based detectors.
-
class
dyndnsc.detector.teredo.
IPDetector_Teredo
(iface='tun0', netmask='2001:0000::/32', *args, **kwargs)[source]¶ IPDetector to detect a Teredo ipv6 address of a local interface.
Bits 0 to 31 of the ipv6 address are set to the Teredo prefix (normally 2001:0000::/32). This detector only checks the first 16 bits! See http://en.wikipedia.org/wiki/Teredo_tunneling for more information on Teredo.
Inherits IPDetector_Iface and sets default options only.
Initialize.
Web check¶
Module containing logic for webcheck based detectors.
-
class
dyndnsc.detector.webcheck.
IPDetectorWebCheck
(*args, **kwargs)[source]¶ Class to detect an IPv4 address as seen by an online web site.
Return parsable output containing the IP address.
Note
This detection mechanism requires ipv4 connectivity, otherwise it will simply not detect the IP address.
Initialize.