Inflammatory bowel diseases (IBDs), including Crohn's disease (CD) and ulcerative colitis (UC), are chronic conditions characterized by periods of intestinal inflammation and have become global diseases. Dietary pectins have shown protective effects on IBD models. However, the development of pectin-based diet intervention for IBD individuals requires knowledge of both the bioactive structural patterns and the mechanisms underlying diet-microbiota-host interactions. Here, dextran sulfate sodium (DSS) induced colitis mice were fed with different pectins with various domain compositions, including AG, P37, P55 and P85, in order to understand why different structural patterns function differently on colitis mouse models. The structural diversity of pectin manifests in the different percentages of the homogalacturonan (HG) backbone, Ara sidechains, and Gal sidechains. AG comprises only neutral sugar chains consisting of 14% Ara and 86% Gal, and P85 is a commercial HG pectin mainly composed of 85% HG. P37 and P55 were isolated from raspberry pulps with different domain ratios (P37 = 37% HG + 22% Ara + 32% Gal; P55 = 55% HG + 16% Ara + 18% Gal). Compared to the monotonous structure of AG and P85, the domain-diverse pectins P37 and P55 show superior protective effects against colitis through inhibiting the proliferation of the mucin-consuming bacteria and the pro-inflammatory microorganisms, potentiating the MUC2 expression and the mucus layer and regulating the gut-spleen axis. The HG structure promoted the proliferation of the mucin-degrading microbiota and potentiated mucus erosion. AG enhanced the mucus thickness but increased the growth of the pro-inflammatory microbiota. Our study revealed that the specific domain composition of pectic fibers was a key factor on which the diet-induced alterations in the gut microbiota and the intestinal barrier function highly depended.