# 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 socket
import logging
from .base import IPDetector, AF_INET, AF_INET6, AF_UNSPEC
# -*- coding: utf-8 -*-

"""Module containing logic for dns based detectors."""



LOG = logging.getLogger(__name__)


def resolve(hostname, family=AF_UNSPEC):
    """
    Resolve hostname to one or more IP addresses through the operating system.

    Resolution is carried out for the given address family. If no
    address family is specified, only IPv4 and IPv6 addresses are returned. If
    multiple IP addresses are found, all are returned.

    :param family: AF_INET or AF_INET6 or AF_UNSPEC (default)
    :return: tuple of unique IP addresses
    """
    af_ok = (AF_INET, AF_INET6)

# 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/dns.py
import socket
import logging
from .base import IPDetector, AF_INET, AF_INET6, AF_UNSPEC

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

"""Module containing logic for dns based detectors."""



LOG = logging.getLogger(__name__)


def resolve(hostname, family=AF_UNSPEC):
    """
    Resolve hostname to one or more IP addresses through the operating system.

    Resolution is carried out for the given address family. If no
    address family is specified, only IPv4 and IPv6 addresses are returned. If
    multiple IP addresses are found, all are returned.

    :param family: AF_INET or AF_INET6 or AF_UNSPEC (default)
    :return: tuple of unique IP addresses
    """
    af_ok = (AF_INET, AF_INET6)

    if family != AF_UNSPEC and family not in af_ok: