Type 2 diabetes mellitus (T2DM) is a chronic metabolic disorder characterized by persistent abnormally elevated blood sugar levels. T2DM affects millions of people and exerts a significant global public health burden. Danggui Buxue decoction (DBD), a classical Chinese herbal formula composed of Astragalus membranaceus (Huangqi) and Angelica sinensis (Danggui), has been widely used in the clinical treatment of diabetes and its complications. However, the effect of DBD on the gut microbiota of individuals with diabetes and its metabolism are still poorly understood. In this study, a T2DM model was established in Goto-Kakizaki (GK) rats, which were then treated with a clinical dose of DBD (4 g/kg) through tube feeding for 6 weeks. Next, we used 16S rRNA sequencing and untargeted metabolomics by liquid chromatography with mass spectrometry (LC–MS) to detect changes in the composition of the microbiota and cecal metabolic products. Our data show that DBD mediates the continuous increase in blood glucose in GK rats, improves insulin sensitivity, reduces expression of inflammatory mediators, and improves systemic oxidative stress. Moreover, DBD also improves microbial diversity (e.g., Romboutsia, Firmicutes, and Bacilli) in the intestines of rats with T2DM. Further, DBD intervention also regulates various metabolic pathways in the gut microbiota, including alanine, aspartate, and glutamate metabolism. In addition, arginine biosynthesis and the isoflavone biosynthesis may be a unique mechanism by which DBD exerts its effects. Taken together, we show that DBD is a promising therapeutic agent that can restore the imbalance found in the gut microbiota of T2DM rats. DBD may modify metabolites in the microbiota to realize its antidiabetic and anti-inflammatory effects.