Check that name is DNS subdomain: One or more lowercase rfc1035/rfc1123
    labels separated by '.' with a maximum length of 253 characters

def _is_dns_subdomain(name):
    ''' Check that name is DNS subdomain: One or more lowercase rfc1035/rfc1123
    labels separated by '.' with a maximum length of 253 characters '''

    dns_subdomain = re.compile(r"""^[a-z0-9\.-]{1,253}$""")
    if dns_subdomain.match(name):
        log.debug("Name: %s is valid DNS subdomain", name)
        return True
    else:
        log.debug("Name: %s is not valid DNS subdomain", name)
        return False