def _is_dns_available(self, domain):
        # Naive check to see if there is DNS available to use.
        # Used to conditionally skip fqdn geoip checks.
        # See #25407 for details.
        ErrClass = socket.error if six.PY2 else OSError
        try:
            socket.gethostbyname(domain)
            return True
        except ErrClass:
            return False