Abstract The ability of near-infrared spectroscopy to trace cow feeding systems and farming altitude was tested on 486 bulk milk samples from France and northwestern Italy. Milks were grouped into feeding systems according to the main forage in the diet. Partial least square discriminant analysis correctly classified 95.5, 91.5, and 93.3% of pasture versus maize silage, hay, and fermented herbage feeding systems, respectively. Discrimination was slightly less successful when diets with large proportions of the nondominant forage were included in each group. Near-infrared spectroscopy correctly discriminated no-pasture from pasture milk, even with only 30% of pasture in the diet (5.4% cross-validation error), and the error stabilized when pasture exceeded 70% (2.5% error). Near-infrared spectroscopy did not reliably trace milk geographic origin when the feeding system effect was isolated from the altitude effect. These findings may be usefully exploited for the authentication of dairy products.