code: func FindZoneByFqdnCustom(fqdn string, nameservers []string) (string, error) {
  	muFqdnToZone.Lock()
  	defer muFqdnToZone.Unlock()
  
  	// Do we have it cached?
  	if zone, ok := fqdnToZone[fqdn]; ok {
  		return zone, nil
  	}
  
  	var err error
  	var in *dns.Msg
  
  	labelIndexes := dns.Split(fqdn)
  	for _, index := range labelIndexes {
  		domain := fqdn[index:]
  
  		in, err = dnsQuery(domain, dns.TypeSOA, nameservers, true)
  		if err != nil {
  			continue
  		}
  
  		if in == nil {
  			continue
  		}
  
  		switch in.Rcode {
  		case dns.RcodeSuccess:
  			// Check if we got a SOA RR in the answer section
  
  			if len(in.Answer) == 0 {
  				continue
  			}
  
  			// CNAME records cannot/should not exist at the root of a zone.
  			// So we skip a domain when a CNAME is found.
  			if dnsMsgContainsCNAME(in) {
  				continue
  			}
  
  			for _, ans := range in.Answer {
  				if soa, ok := ans.(*dns.SOA); ok {
  					zone := soa.Hdr.Name
  					fqdnToZone[fqdn] = zone
  					return zone, nil
  				}
  			}
  		case dns.RcodeNameError:
  			// NXDOMAIN
  		default:
  			// Any response code other than NOERROR and NXDOMAIN is treated as error
  			return "", fmt.Errorf("unexpected response code '%s' for %s", dns.RcodeToString[in.Rcode], domain)
  		}
  	}
  
  	return "", fmt.Errorf("could not find the start of authority for %s%s", fqdn, formatDNSError(in, err))
  }
docs: // FindZoneByFqdnCustom determines the zone apex for the given fqdn
  // by recursing up the domain labels until the nameserver returns a SOA record in the answer section.