Adaptation during the domestication from wolves (Canis lupus) to dogs (Canis lupus familiaris) is a debated ecological topic. Changes in food and environment are major divergences in the domestication of dogs. Gut microbes play an important role in animal adaptation to the food and environmental changes. In this study, shotgun sequencing was performed to compare the species diversity and functional diversity of gut microbes in wild wolves (group CLW, n = 3), captive wolves (group CLC, n = 4), and domestic dogs (group CLF, n = 4). The results found that Bacteroidetes, Firmicutes, Fusobacteria, Proteobacteria and Actinobacteria were the most abundant phyla and Bacteroides, Fusobacterium, Prevotella, Megamonas, Paraprevotella, Faecalibacterium, Clostridium were the most abundant genera in the gut of wolves and dogs. Groups CLW, CLC and CLF have shown significant difference in gut microbial species diversity and functional diversity. Bacteroides, Fusobacterium and Faecalibacterium were most abundant genera in groups CLW, CLC and CLF, respectively. Their abundance varied significantly among groups. Compared to the wild wolves, the intestinal microbiol genes of domestic dogs were significantly enriched in the carbohydrate metabolism pathway of KEGG database. One hundred and seventy-seven enzymes were detected with significantly higher abundance in group CLF than that in group CLW, and 49 enzymes showed extremely significant higher abundance in group CLF than that in group CLW (q < 0.01) base on the function abundance annotated in CAZy database. It is noteworthy that there were also significant differences in the abundance of 140 enzymes between groups CLC and CLW (q < 0.05). Clustering analysis based on both the species and the function abundance of intestinal microbiota all found that groups CLC and CLF clustered into one branch, while samples from group CLW clustered into the other branch. This result suggests that captive wolves are more similar to domestic dogs than wild wolves in both species composition and function composition of intestinal microbiota.