'get_public_suffix("www.example.com") -> "example.com"
Calling this function with a DNS name will return the
public suffix for that name.
Note that for internationalized domains the list at
http://publicsuffix.org uses decoded names, so it is
up to the caller to decode any Punycode-encoded names.'

def get_public_suffix(self, domain):

    parts = domain.lower().lstrip('.').split('.')
    hits = ([None] * len(parts))
    self._lookup_node(hits, 1, self.root, parts)
    for (i, what) in enumerate(hits):
        if ((what is not None) and (what == 0)):
            return '.'.join(parts[i:])
