Pruritus ani lotion combined with a Chinese medicine formula named Huajiao (Pericarpium Zanthoxyli Bungeani)-Gancao (Radix Glycyrrhizae)-Bingpian (Borneol) is effective in treating pruritus ani. To investigate the mechanism of traditional Chinese medicine (TCM) in pruritus ani via network pharmacology and molecular dynamics (MD). The Traditional Chinese Medicine Systems Pharmacology Database and Analysis Platform (TCMSP) was utilised to screen active ingredients and their corresponding targets. Genes associated with pruritus ani were collected through GeneCards. Protein-protein interaction (PPI) network between target genes of the active ingredients of this formula and genes associated with pruritus ani was established through the STRING database. A drug-active ingredient-gene interaction network was constructed using Cytoscape with the top 50 genes in affinity coefficients. Molecular docking and MD simulation analysis were performed. Epidermal growth factor receptor (EGFR) and Signal Transducer and Activator of Transcription 3 (STAT3) were core genes. Direct targeting of EGFR by the active ingredients (quercetin and luteolin) and direct targeting of STAT3 by the active ingredient (licochalcone A) may be key molecular mechanisms for the treatment of pruritus ani. Simulated trajectories of structural nuclear motion by MD also revealed that the binding of two pairs of molecules was relatively stable. This study unravels potential targets, active ingredients, and mechanisms of pruritus ani lotion combined with Huajiao-Gancao-Bingpian oil in the treatment of pruritus ani, providing a reference for future treatment.