code: func (c *Config) Domain() (string, error) {
  	domain := ""
  	for _, v := range strings.Split(strings.ToLower(c.BaseDN), ",") {
  		if trimmed := strings.TrimSpace(v); strings.HasPrefix(trimmed, "dc=") {
  			domain = domain + "." + trimmed[3:]
  		}
  	}
  	if len(domain) <= 1 {
  		return "", errors.New("Configuration error: invalid BaseDN")
  	}
  	return domain[1:], nil
  }
docs: //Domain returns the domain derived from BaseDN or an error if misconfigured.