def getIPx(domain):
 try:
  return socket.gethostbyname_ex(domain)[2]
 except Exception:
  return False

def getIPx ( domain ) : try : return socket . gethostbyname_ex ( domain ) [ 2 ] except Exception : return False
this method returns an array containing one or more ip address strings that respond as the given domain name .