'Takes a domain like `www.reddit.com`, and returns a list of ways
that a user might search for it, like:
* www
* reddit
* com
* www.reddit.com
* reddit.com
* com'

def domain_permutations(self, fragments=False, subdomains=True):

    ret = set()
    if self.hostname:
        r = self.hostname.split('.')
        if subdomains:
            for x in xrange((len(r) - 1)):
                ret.add('.'.join(r[x:len(r)]))
        if fragments:
            for x in r:
                ret.add(x)
    return ret
