code: func cnameResolve(host string, resolvPath string) (*cnameResolv, error) {
  	config, err := dns.ClientConfigFromFile(resolvPath)
  	if err != nil {
  		return nil, fmt.Errorf("invalid resolver configuration file: %s", resolvPath)
  	}
  
  	client := &dns.Client{Timeout: 30 * time.Second}
  
  	m := &dns.Msg{}
  	m.SetQuestion(dns.Fqdn(host), dns.TypeCNAME)
  
  	var result []*cnameResolv
  	for _, server := range config.Servers {
  		tempRecord, err := getRecord(client, m, server, config.Port)
  		if err != nil {
  			log.Errorf("Failed to resolve host %s: %v", host, err)
  			continue
  		}
  		result = append(result, tempRecord)
  	}
  
  	if len(result) == 0 {
  		return nil, nil
  	}
  
  	sort.Sort(byTTL(result))
  	return result[0], nil
  }
docs: // cnameResolve resolves CNAME if exists, and return with the highest TTL