'The function for retrieving host information for an IP address.
Args:
retry_count: The number of times to retry in case socket errors,
timeouts, connection resets, etc. are encountered.
Returns:
Tuple: hostname, aliaslist, ipaddrlist
Raises:
HostLookupError: The host lookup failed.'

def get_host(self, retry_count=3):

    try:
        default_timeout_set = False
        if (not socket.getdefaulttimeout()):
            socket.setdefaulttimeout(self.timeout)
            default_timeout_set = True
        log.debug('Host    query    for    {0}'.format(self.address_str))
        ret = socket.gethostbyaddr(self.address_str)
        if default_timeout_set:
            socket.setdefaulttimeout(None)
        return ret
    except (socket.timeout, socket.error) as e:
        log.debug('Host    query    socket    error:    {0}'.format(e))
        if (retry_count > 0):
            log.debug('Host    query    retrying    (count:    {0})'.format(str(retry_count)))
            return self.get_host((retry_count - 1))
        else:
            raise HostLookupError('Host    lookup    failed    for    {0}.'.format(self.address_str))
    except:
        raise HostLookupError('Host    lookup    failed    for    {0}.'.format(self.address_str))
