Lianhua Qingwen capsule (LHQW) can attenuate lung injury caused by influenza virus infection. However, it is unclear whether the intestinal microbiota plays a role in LHQW activity in ameliorating viral infectious pneumonia. This study aimed to investigate the role of intestinal microbiota in LHQW activity in ameliorating viral infectious pneumonia and its possible mechanisms. A mouse model of influenza A viral pneumonia was established by intranasal administration in BALB/c mice. Detection of influenza virus in the lungs, pathological examination of the lungs and small intestine, and biochemical detection of inflammatory indices were performed. The effects of LHQW on intestinal microbiota were evaluated by 16S rRNA gene sequencing. The key components and targets of LHQW were screened via network pharmacology and verified through molecular docking, molecular dynamics simulation, and free binding energy calculations. Body weight decreased, inflammatory factor levels were disturbed, and the lung and intestinal mucosal barriers were significantly injured in the infected group. The alpha diversity of the intestinal microbiota decreased, and the abundance of Bacteroidetes, Muribaculaceae_unclassified, and Streptococcus decreased significantly. LHQW treatment reduced the viral load in the lungs, rescued body weight and survival, alleviated lung and intestinal mucosal barrier injury, reversed the reduction in the intestinal microbiota alpha diversity, and significantly increased the abundance of Bacteroidetes and Muribaculaceae. Network pharmacological analysis showed that six active herbal medicinal compounds from LHQW could regulate the intestinal microbiota and inhibit the immune-inflammatory response through the Toll-like receptor (TLR) and nuclear factor-κB (NF-κB) signalling pathways in the lungs. These results suggest that LHQW is effective for treating influenza A virus infectious pneumonia, and the mechanism is associated with the regulation of the TLR4/NF-κB signalling pathway in the lungs by restoring intestinal microbiota and repairing the intestinal wall.