Abstract Background Vitamin D was shown to directly exert a protective effect on diabetic kidney disease (DKD) in our previous study. However, whether it has an effect on perirenal adipose tissue (PRAT) or the intestinal flora and its metabolites (trimethylamine N-oxide, TMAO) is unclear. Methods DKD mice were received different concentrations of 1,25-(OH) 2 D 3 for 2 weeks. Serum TNF-α levels and TMAO levels were detected. 16S rRNA sequencing was used to analyze gut microbiota. qPCR was used to detect the expression of TLR4, NF-Κb, PGC1α, and UCP-1 in kidney and adipose tissue. Histological changes in kidney and perirenal adipose tissue were observed using HE, PAS, Masson and oil red staining. Immunofluorescence and immunohistochemistry were used to detect the expression of VDR, PGC1α, podocin, and UCP-1 in kidney and adipose tissue. Electron microscopy was used to observe the pathological changes in the kidney. VDR knockout mice were constructed to observe the changes in the gut and adipose tissue, and immunofluorescence and immunohistochemistry were used to detect the expression of UCP-1 and collagen IV in the kidney. Results 1,25-(OH) 2 D 3 could improve the dysbiosis of the intestinal flora of mice with DKD, increase the abundance of beneficial bacteria, decrease the abundance of harmful bacteria, reduce the pathological changes in the kidney, reduce fat infiltration, and downregulate the expression of TLR4 and NF-κB in kidneys. The serum TMAO concentration in mice with DKD was significantly higher than that of the control group, and was significantly positively correlated with the urine ACR. In addition, vitamin D stimulated the expression of the surface markers PGC1α, UCP-1 and VDR in the PRAT in DKD mice, and TMAO downregulated the expression of PRAT and renal VDR. Conclusions The protective effect of 1,25-(OH) 2 D 3 in DKD mice may affect the intestinal flora and its related metabolite TMAO on perirenal fat and kidneys.