If a goat and a hippo walk into a watering hole on the savanna, they could end up sharing a lot more than just a drink. Intestinal parasites, transmitted through water and food, can inflict damage ranging from stunted growth to starvation and death. To predict how these worms might spread in places such as central Kenya, where wild and domestic herbivores increasingly mingle, scientists are trying to get a better understanding of which parasites live in which species—and why.

A new study in the Proceedings of the Royal Society B shows that intestinal parasites are choosy about their living quarters; related parasite species tend to congregate in animals whose guts are alike. By chemically analyzing 550 fecal samples from 17 herbivore species, researchers identified snippets of parasite genes, called DNA barcodes, to catalogue the parasite populations likely to be living in the animals' guts. The 80 or so worm types they found seemed to be split between two different kinds of digestive systems. Some stuck to simple, single-chambered stomachs, and others preferred multichambered ones, like cows and camels have. Even unrelated species such as elephants and donkeys—which have little in common except for their single-chambered stomachs—had genetically similar parasites, suggesting these mammals might infect one another.

Knowing which worms live in whom helps farmers and conservation experts manage parasite spread. Many farmers in Kenya have recently swapped cows for drought-resistant livestock, including camels, in response to longer dry seasons. Although camels are genetically very different from their new savanna neighbors, they evidently share parasites with many wild and domestic animals—particularly cows. And 90 percent of camels sampled had parasites, compared with an average of 65 percent for other species sharing multichambered stomachs.

“We had no idea that camels were that infected and that they shared their parasites with so much of the wildlife,” says the study's lead author Georgia Titcomb, a disease ecologist at the University of California, Santa Barbara. Based on her paper's results, local wildlife managers have decided to deworm camels in the study area to protect animals such as giraffes, whose numbers are declining.

To identify intestinal worms, most parasite researchers use slow, expensive processes such as culling animals or combing through feces under a microscope for parasite eggs. Without DNA barcodes, Titcomb and her team could not have gotten such a full picture of the parasite population.

“I do think that these are the perfect tools to ask exactly these kinds of questions, such as what determines the composition of parasite communities,” says Sebastién Calvignac-Spencer, a disease ecologist at the Robert Koch Institute in Berlin, who was not involved in this work but uses DNA barcodes to study mammal viruses. Both researchers hope that this approach will gain traction among parasitologists.