def getAlias(domain):
 try:
  data = socket.gethostbyname_ex(domain)
  alias = repr(data[1])
  return alias
 except Exception:
  return False

def getAlias ( domain ) : try : data = socket . gethostbyname_ex ( domain ) alias = repr ( data [ 1 ] ) return alias except Exception : return False
this method returns an array containing a list of aliases for the given domain .