Sensory neurons in the gastrointestinal tract have multi-faceted roles in maintaining homeostasis, detecting danger, and initiating protective responses. The gastrointestinal tract is innervated by three types of sensory neurons: dorsal root ganglia, nodose/jugular ganglia, and intrinsic primary afferent neurons. Here, we examine how these distinct sensory neurons and their signal transducers participate in regulating gastrointestinal inflammation and host defense. Sensory neurons are equipped with molecular sensors that enable neuronal detection of diverse environmental signals including thermal and mechanical stimuli, inflammatory mediators, and tissue damage. Emerging evidence shows that sensory neurons participate in host–microbe interactions. Sensory neurons are able to detect pathogenic and commensal bacteria through specific metabolites, cell-wall components, and toxins. Here we review recent work on the mechanisms of bacterial detection by distinct subtypes of gut-innervating sensory neurons. Upon activation, sensory neurons communicate to the immune system to modulate tissue inflammation through antidromic signaling and efferent neural circuits. We discuss how this neuro-immune regulation is orchestrated through transient receptor potential ion channels and sensory neuropeptides including substance P, calcitonin gene-related peptide, vasoactive intestinal peptide, and pituitary adenylate cyclase-activating polypeptide. Recent studies also highlight a role for sensory neurons in regulating host defense against enteric bacterial pathogens including Salmonella typhimurium, Citrobacter rodentium, and enterotoxigenic Escherichia coli. Understanding how sensory neurons respond to gastrointestinal flora and communicate with immune cells to regulate host defense enhances our knowledge of host physiology and may form the basis for new approaches to treat gastrointestinal diseases.