Ulcerative colitis (UC) is a chronic inflammatory bowel disease (IBD) with limited treatment options. The natural compound 1,2,4-Trimethoxybenzene (ZY12) is a known NLRP3 inflammasome inhibitor, but its potential in UC remains unclear. This study evaluated the efficacy of ZY12 using a dextran sulfate sodium (DSS)-induced mouse model and integrated molecular, histological, 16S ribosomal RNA (16S rRNA) sequencing, short-chain fatty acids (SCFAs) and metabolomics analyses. Results showed that ZY12 significantly alleviated DSS-induced UC in mice, as evidenced by reduced weight loss, less colon shortening, and lower DAI scores. Mechanistically, ZY12 effectively inhibited NLRP3 inflammasome activation and downregulated the expression of pro-inflammatory cytokines, specifically interleukin-1β (IL-1β), interleukin-6 (IL-6), and tumor necrosis factor-α (TNF-α), and also reduced the level of calprotectin (S100A8/A9), a clinical marker of intestinal inflammation. Furthermore, ZY12 ameliorated colonic oxidative stress by enhancing the activities of the antioxidant enzymes superoxide dismutase (SOD) and glutathione peroxidase (GSH-Px), while reducing the levels of the oxidative damage markers malondialdehyde (MDA) and myeloperoxidase (MPO). Concurrently, ZY12 upregulated the key intestinal barrier-related proteins, namely Claudin-1, Occludin, zonula occludens-1 (ZO-1), and mucin 2 (MUC2). Comprehensive analyses revealed that ZY12 reshapes the gut microbiota composition by enriching beneficial bacterial taxa, increases levels of SCFAs (i.e., acetic acid, propionic acid, and butyric acid), and restores dysregulated host-microbiota co-metabolism, particularly through targeted modulation of the primary bile acid biosynthesis pathway. In conclusion, ZY12 alleviates UC via a synergistic regulatory network involving "immune modulation-microbiota reshaping-metabolic restoration". These findings highlight ZY12's potential as a promising multi-target therapeutic candidate for UC.