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

def resolve_hostname ( hostname ) : res = socket . getaddrinfo ( hostname , None ) [ 0 ] ( family , socktype , proto , canonname , sockaddr ) = res return sockaddr [ 0 ]
resolves host name to ip address .