We now show that during pregnancy, administration of a diet rich in the aryl hydrocarbon receptor (AHR) ligand indole-3-carbinole (I3C), or of breast milk, activates AHR and prevents NEC in newborn mice by reducing Toll-like receptor 4 (TLR4) signaling in the newborn gut. Here, TLR4 is linked to necrotizing enterocolitis.