def get_domains(name):
 name = name.split('.')
 return ('.'.join(name[i:]) for i in xrange(len(name)))

def get_domains ( name ) : name = name . split ( '.' ) return ( '.' . join ( name [ i : ] ) for i in xrange ( len ( name ) ) )
generates the upper domains from a domain name .