def getIP(domain):
 try:
  return socket.gethostbyname(domain)
 except Exception:
  return False

def getIP ( domain ) : try : return socket . gethostbyname ( domain ) except Exception : return False
this method returns the first ip address string that responds as the given domain name .