# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():


import logging
import dns.resolver
from .base import IPDetector, AF_INET, AF_INET6
# -*- coding: utf-8 -*-

"""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/
"""
from __future__ import absolute_import




LOG = logging.getLogger(__name__)


def find_ip(family=AF_INET, provider="opendns"):
    """Find the publicly visible IP address of the current system.

    This uses public DNS infrastructure that implement a special DNS "hack" to
    return the IP address of the requester rather than some other address.

    :param family: address family, optional, default AF_INET (ipv4)
    :param flavour: selector for public infrastructure provider, optional
    """
    dnswanipproviders = {
        "opendns": {
            AF_INET: {
                "@": ("resolver1.opendns.com", "resolver2.opendns.com"),
                "qname": "myip.opendns.com",
                "rdtype": "A",
            },

# Path: dyndnsc/detector/base.py
# LOG = logging.getLogger(__name__)
# class IPDetector(Subject, DynamicCliMixin):
#     def __init__(self, *args, **kwargs):
#     def can_detect_offline(self):
#     def af(self):
#     def get_old_value(self):
#     def set_old_value(self, value):
#     def get_current_value(self, default=None):
#     def set_current_value(self, value):
#     def has_changed(self):
#     def configuration_key_prefix():


# Path: dyndnsc/detector/dnswanip.py
import logging
import dns.resolver
from .base import IPDetector, AF_INET, AF_INET6

# -*- coding: utf-8 -*-

"""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/
"""
from __future__ import absolute_import




LOG = logging.getLogger(__name__)


def find_ip(family=AF_INET, provider="opendns"):
    """Find the publicly visible IP address of the current system.

    This uses public DNS infrastructure that implement a special DNS "hack" to
    return the IP address of the requester rather than some other address.

    :param family: address family, optional, default AF_INET (ipv4)
    :param flavour: selector for public infrastructure provider, optional
    """
    dnswanipproviders = {
        "opendns": {
            AF_INET: {
                "@": ("resolver1.opendns.com", "resolver2.opendns.com"),
                "qname": "myip.opendns.com",
                "rdtype": "A",
            },

            AF_INET6: {