We show, in mice, that repeated injection of flagellin elicits increases in fecal anti-flagellin IgA and alterations in microbiota composition, reduces fecal flagellin concentration, prevents microbiota encroachment, protects against IL-10 deficiency-induced colitis, and ameliorates diet-induced obesity. This evidence concerns the gene CD79A and obesity due to melanocortin 4 receptor deficiency.