The effect of feeding cashew nut shell liquid (CNSL) on fecal fermentation products and microbiota was investigated in Thai native cattle and swamp buffaloes. Four of each animal were fed rice straw and concentrate diet with control pellets without CNSL for 4 weeks, followed by the same diet with pellets containing CNSL for another 4 weeks, so that CNSL was administered at a level of 4 g/100 kg body weight. Feces were collected the last 2 days in each feeding period. CNSL alkyl phenols were recovered from feces (16%–28%) in a similar proportion to those in the diet, indicating that most functional anacardic acid was not selectively removed throughout the digestive tract. In vitro production of gas from feces, particularly methane, decreased with CNSL feeding. The proportion of acetate in feces decreased with CNSL feeding, whereas that of propionate increased, without affecting total short‐chain fatty acid concentration. CNSL feeding changed fecal microbial community, particularly in swamp buffaloes, which exhibited decreases in the frequencies of Treponema, unclassified Ruminococcaceae, and Methanomassiliicoccaceae. These results suggest that CNSL feeding alters not only rumen fermentation but also hindgut fermentation via modulation of the microbial community, thereby potentially attenuating methane emission from the feces of ruminant animals.