"Holy Cow: A Modern-Day Dairy Tale" by David Duchovny . (FSG)

Whenever a Hollywood celebrity publishes a novel, listen closely: You’ll hear book critics everywhere sharpening their knives. (It’s a little louder when that celebrity is James Franco.) But David Duchovny, best known for his work on “The X-Files” and “Californication,” won’t suffer a hatchet job here. His zany, madcap first novel, “Holy Cow,” which follows the publication last year of “X-Files” co-star Gillian Anderson’s first novel, is a seriously entertaining fable that doesn’t take itself too seriously.

“Holy Cow” is narrated by Elsie Bovary, a chatty, plucky dairy cow from a small farm in upstate New York. Elsie spends her days getting milked, grazing and daydreaming with her “bff” Mallory about the bulls on the other side of the fence.

One night, the two sneak out to meet the fellas in person, but Elsie wanders off to the farmer’s house. Through an open window, she catches a horrifying glimpse of a TV program showing cows being slaughtered at an industrial farm. “A world of blood. The blood of my kind,” she says. “I emptied the contents of all four of my stomachs.”

Later, the TV program mentions India, where cows are sacred and “no one eats them.” Elsie decides to go there, and Jerry, a pig who converts to Judaism, insists on tagging along. He wants to go to Israel. “I’d be a god and he’d be a devil,” Elsie says, “and we both would live.” Finally, Tom, a smooth-talking turkey, joins the duo. November, a bad month for his kind in this country, is just around the corner. So he wants to go to, you guessed it, Turkey.

So, off the three go to save their hides. Their journey is amusingly botched as they head to Turkey, where they steal a jet and fly to Israel and then India. Along the way, they get into a few spectacular messes, learn a lot about themselves and each other, and score a few excellent zingers at us all. “You humans are funny,” Elsie points out while pondering the idea of reduced fat milk in her Turkish coffee, “constantly thinking about eating and trying to look like you never eat at the same time.” Also, the pig gets circumcised.

David Duchovny arrives at the NBCUniversal Golden Globes afterparty at the Beverly Hilton Hotel on Sunday, Jan. 11, 2015, in Beverly Hills, Calif. (Arnold Turner/Invision/AP)

Duchovny, who earned a master’s degree in English literature from Yale, is a witty writer, and he’s especially good at conjuring these oddball voices. Early in the book, for instance, Elsie tells us that her editor has warned against suggesting who should play her in a movie. “She says producers like to think everything is their idea. So I’ll hold my tongue. Jennifer Lawrence.”

Parts of the novel are written like a screenplay (the author says he first pitched the story, unsuccessfully, to Disney and Pixar), and its illustrations, by Natalya Balnova, are a cross between the work of Gary Larson and Roz Chast. Perhaps the funniest depicts Elsie and her pals practicing walking on two legs. “Think of this (screenplay alert!) as the ‘Feeling Strong Now’ montage from Rocky,” she says, “. . . except it doesn’t end with someone punching the hanging carcass of a cow.”

“Holy Cow” lightly touches on big ideas such as religion and tolerance. But, at its heart, this is a silly, charming story about growing up. “Innocence is nice, but the world offers us more and it’s wrong not to take it,” Elsie says early in the book. “You can’t stay a calf forever.”

John Wilwol is a writer in Washington.

HOLY COW

By David Duchovny

Publisher. Farrar Straus Giroux. 206 pp. $24.