Mallards (Anas platyrhynchos) are currently one of the most popular species in rare bird breeding in several southern provinces of China, but there have been no studies comparing the gut microbial communities of domestic and wild mallards. In this study, 16S rRNA gene high-throughput sequencing technology was used to compare the composition and diversity of gut microbial communities in domestic and wild mallards. Alpha diversity analysis showed significant differences in gut microbial communities between the two groups of mallards, and the diversity and richness of gut microbial communities were significantly higher in wild mallards than in domestic mallards. Beta diversity analysis showed that the two groups of stool samples were mostly separated on the principal coordinate analysis (PCoA) plot. In domestic mallards, Firmicutes (68.0% ± 26.5%) was the most abundant bacterial phylum, followed by Proteobacteria (24.5% ± 22.9%), Bacteroidetes (3.1% ± 3.2%), Fusobacteria (2.2% ± 5.9%), and Actinobacteria (1.1% ± 1.8%). The dominant bacterial phyla in wild mallards were Firmicutes (79.0% ± 10.2%), Proteobacteria (12.9% ± 9.5%), Fusobacteria (3.4% ± 2.5%), and Bacteroidetes (2.8% ± 2.4%). At the genus level, a total of 10 dominant genera (Streptococcus, Enterococcus, Clostridium, Lactobacillus, Soilbacillus, Bacillus, Acinetobacter, Comamonas, Shigella, and Cetobacterium) with an average relative abundance greater than 1% were detected in the fecal samples of both groups. The average relative abundance of five potential pathogenic genera (Streptococcus, Enterococcus, Acinetobacter, Comamonas, and Shigella) was higher in domestic mallards than in wild mallards. The enrichment of pathogenic bacteria in the intestinal tract of domestic mallards should be of sufficient concern.