This study investigated the impact of vitamin D on perirenal adipose tissue (PRAT), gut microbiota, and trimethylamine N-oxide (TMAO) in mice with diabetic kidney disease (DKD). Different concentrations of 1,25-(OH)2D3 were administered to DKD mice, and various analyses were performed, including 16S rRNA sequencing, qPCR, histological staining, and immunofluorescence. Results showed that 1,25-(OH)2D3 improved gut dysbiosis, reduced kidney damage, decreased fat infiltration, and downregulated TLR4/NF-κB expression. Serum TMAO levels were positively correlated with urinary albumin-creatinine ratio (ACR). Vitamin D stimulated the expression of PGC1α and UCP-1 in PRAT, while TMAO downregulated VDR expression in PRAT and kidneys. The study concludes that vitamin D's protective effects in DKD may involve modulating gut microbiota, TMAO, and PRAT.