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

def _is_dns_subdomain ( name ) : dns_subdomain = re . compile ( '^[a-z0-9\\.-]{1,253}$' ) if dns_subdomain . match ( name ) : log . debug ( 'Name: {0} is valid DNS subdomain' . format ( name ) ) return True else : log . debug ( 'Name: {0} is not valid DNS subdomain' . format ( name ) ) return False
check that name is dns subdomain: one or more lowercase rfc1035/rfc1123 labels separated by .