Flaxseed supplementation in diet of dairy cow can effectively enhance the production of ω-3 polyunsaturated fatty acids (n-3 PUFA) in raw milk, which further give rise to the changes of volatile organic compounds (VOCs). In this study, we used headspace-gas chromatography-ion mobility spectrometry (HS-GC-IMS) to investigate the VOCs in milk from cows fed three different diets (CK: supplemented with 0 g/d flaxseed; WF: 1,500 g/d whole flaxseed and GF: 1,500 g/d ground flaxseed). A total of 40 VOCs including three acids, six esters, 11 aldehydes, seven alcohols, 13 ketones were identified in all the raw milk samples. Compared with GF supplementation, suppling with WF could influence more compounds in raw milk (GF: five compounds; WF: 22 compounds). Supplementation with WF could increase the concentration of nonanal, heptanal, hexanal, which could cause the occurrence of off-flavors, and reduce the concentration of hexanoic acid (monomer; M), 2-hexanol, ethanol (M), 2-heptanone (dimer; D), 2-pentanone (M), 2-pentanone (D), acetoin (M) in raw milk. GF supplementation in diet could reduce the 2-pentanone (M), 2-pentanone (D). In addition, principal component analysis (PCA) based on the signal intensity of identified VOCs indicated that it is possible to distinguish between the CK and WF milk. However, GF milk could not be distinguished from CK milk. The results demonstrate that compared with GF milk, WF supplementation in diet of dairy cows could increase fishy (heptanal) cardboard-like (pentanal) flavor in milk and decrease sweet (hexanoic acid, 2-heptanone), fruity (ethyl butanoate, ethyl hexanoate, 2-heptanone) flavor which may lead the milk less acceptable. In conclusion, compared with WF, GF supplementation in diet of dairy cow showed higher increase in n-3 PUFA in raw milk, and less influence in VOCs of raw milk and this study might provide theoretical supports for the production of milk rich in n-3 PUFA.