NOX/DUOX family of NADPH oxidases are expressed in diverse tissues and are the primary enzymes for the generation of reactive oxygen species (ROS). The intestinal epithelium expresses NOX1, NOX4, and DUOX2, whose functions are not well understood. To address this, we generated mice with complete or epithelium-restricted deficiency in the obligatory NOX dimerization partner Cyba (p22phox). We discovered that NOX1 regulates DUOX2 expression in the intestinal epithelium, which magnified the epithelial ROS-deficiency. Unexpectedly, epithelial deficiency of Cyba resulted in protection from C. rodentium and L. monocytogenes infection. Microbiota analysis linked epithelial Cyba deficiency to an enrichment of H2O2-producing bacterial strains in the gut. In particular, elevated levels of lactobacilli physically displaced and attenuated C. rodentium virulence by H2O2-mediated suppression of the virulence-associated LEE pathogenicity island. This transmissible compensatory adaptation relied on environmental factors, an important consideration for prevention and therapy of enteric disease.