'Resolves host name to IP address.'

def _resolve_hostname(self, hostname):

    res = socket.getaddrinfo(hostname, None)[0]
    (family, socktype, proto, canonname, sockaddr) = res
    return sockaddr[0]
