code: func IsDNSName(str string) bool {
  	if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 {
  		// constraints already violated
  		return false
  	}
  	return rxDNSName.MatchString(str)
  }
docs: // IsDNSName will validate the given string as a DNS name