Muc17 deletion in mice rendered the small intestine particularly prone to atypical bacterial infection while maintaining resistance to colitis. Here, MUC17 is linked to bacterial infectious disease.