Although cetaceans (whales, porpoises, and dolphins) have multi-chambered stomachs, feeding habits of modern cetaceans have dramatically changed from herbivorous to carnivorous. However, the genetic basis underlying this dietary switch remains unexplored. Here, we present the first systematic investigation of 10 digestive enzymes genes (i.e., CYP7A1, CTRC, LIPC, LIPF, PNLIP, PGC, PRSS1, SI, SLC5A1, and TMPRSS15) of representative cetaceans, and the evolutionary trajectory of RNASE1 in cetartiodactylans. Positive selections were detected with proteinases (i.e., CTRC, PRSS1, and TMPRSS15) and lipases (i.e., CYP7A1, LIPF, and PNLIP) suggesting that cetaceans have evolved an enhanced digestion capacity for proteins and lipids, the major nutritional components of their prey (fishes and invertebrates). In addition, it was found that RNASE1 gene duplicated after the cetartiodactylan speciation and two independent gene duplication events took place in Camelidae and Ruminantia. Positive selection was detected with RNASE1 of Camelidae and Bovidae, suggesting enhanced digestive efficiency in the ruminants. Remarkably, even though the ancestors of cetaceans were terrestrial artiodactyls that are herbivorous, modern cetaceans lost the pancreatic RNASE1 copy with digestive function, which is in accordance with the dietary change from herbivorous to carnivorous. In sum, this is the first study that provides new insights into the evolutionary mechanism of dietary switch in cetaceans.