Aim. The aim of this study is to explore the mechanism of action of quercetin, the main active anti-inflammatory component of Ligustrum lucidum, in the prevention and treatment of mastitis. Methods. Prediction of the main active ingredients and key anti-inflammatory targets of Ligustrum lucidum using a network pharmacology platform and molecular biology validation of the results. Observation of histopathological changes in the mouse mammary gland by hematoxylin-eosin staining(H&E) method, quantitative real-time PCR(qPCR), and Western blot (WB) to detect the expression levels of relevant inflammatory factors mRNA and protein. Results. A total of 7 active ingredients and 42 key targets were obtained from the network pharmacological analysis of Ligustrum lucidum, with quercetin as the main core ingredient and tumor necrosis factor(TNF), serine threonine protein kinase1(AKT1), and interleukin6(IL6) as the core targets; H&E results showed that pathological changes were reduced to different degrees in the dose group compared to the model group. The qPCR results showed that the relative expression of TNF and IL6 mRNA in the high dose group on day 3 and the high and medium dose groups on day 7 were not significantly different compared with the blank group (
P
>
0.05
), and the difference between the dose groups on day 5 was significant (
P
<
0.05
). WB results showed that the difference in nuclear factor kappa-B(NF-κB) protein expression in the medium and low dose groups on day 7 was significant compared with the blank group (
P
<
0.05
), the difference in 5 and 7 days, significant differences in AKT1 protein expression between the middle and low dose groups (
P
<
0.05
), nonsignificant differences in the TNF protein expression between the high dose groups on day 7 (
P
>
0.05
), and significant differences in the IL6 protein expression between the middle and low dose groups on days 3 and 7 (
P
<
0.05
). Conclusion. Quercetin, the main active ingredient of Ligustrum lucidum, may act in the prevention and treatment of mastitis by inhibiting the expression of inflammatory factors in phosphoinositol 3-kinase(PI3K)-AKT and NF-κB signaling pathways and showa a significant dose-dependent effect. This study provides theoretical basis and clues for the control of mastitis in dairy cows.