'Checks if a domain is a valid wildcard according to
https://tools.ietf.org/html/rfc6125#section-6.4.3
:param domain:
A unicode string of the domain name, where any U-labels from an IDN
have been converted to A-labels
:return:
A boolean - if the domain is a valid wildcard domain'

def _is_wildcard_domain(self, domain):

    if (domain.count(u'*') != 1):
        return False
    labels = domain.lower().split(u'.')
    if (not labels):
        return False
    if (labels[0].find(u'*') == (-1)):
        return False
    if (labels[0][0:4] == u'xn--'):
        return False
    return True
