Abstract Background Irritable bowel syndrome (IBS) is a condition with undetermined pathophysiology. Dysregulation of the gut–brain axis has been implicated in its development. This study aimed to investigate the association between gut microbial dysbiosis and brain N-methyl-D-aspartate receptor (NMDAR) hyperfunction in a mouse model of post-infectious IBS (PI-IBS) with visceral hypersensitivity. Methods Four-week-old mice were divided into four groups: control mice, PI-IBS mice, PI-IBS mice co-housing with normal mice, and PI-IBS mice administrated with a cocktail of antibiotics. The PI-IBS mouse model was established by using Trichinella spiralis infection. Visceral sensitivity was measured by using the abdominal withdrawal reflex in response to colorectal distension. c-FOS and NMDAR expression in the insula, hippocampus, and hypothalamus were evaluated by using immunostaining and Western blot, respectively. Additionally, NMDAR-mediated evoked excitatory postsynaptic currents (eEPSCs) in these brain regions were recorded by using patch clamp techniques. Results Visceral hypersensitivity was observed in PI-IBS mice compared with control mice. Increased c-FOS expressions were observed in the insula and hippocampus of PI-IBS mice. Although no changes in the NMDAR subtypes expression were observed, enhanced NMDAR-mediated eEPSCs were detected in the insula and hippocampus of PI-IBS mice compared with control mice. Co-housing and antibiotics treatment effectively reduced NMDAR-mediated eEPSCs and alleviated visceral hypersensitivity. Conclusion Gut microbiota dysbiosis may serve as an initiating factor for NMDAR hyperfunction in PI-IBS with visceral hypersensitivity.