code: func (p designateProvider) getHostZoneID(hostname string, managedZones map[string]string) (string, error) {
  	longestZoneLength := 0
  	resultID := ""
  
  	for zoneID, zoneName := range managedZones {
  		if !strings.HasSuffix(hostname, zoneName) {
  			continue
  		}
  		ln := len(zoneName)
  		if ln > longestZoneLength {
  			resultID = zoneID
  			longestZoneLength = ln
  		}
  	}
  
  	return resultID, nil
  }
docs: // finds best suitable DNS zone for the hostname