In this article, a new intrauterine infusion containing rifaximin (RIF) was prepared, a sensitive UPLC-MS/MS method for the determination of RIF in milk was developed, and the residue of drug in milk of dairy cows was carried out. Twelve healthy dairy cows were selected by random and treated by RIF intrauterine infusion at a dosage of 25 g/head (contain RIF187.5 mg). Milk samples were collected before dosing (0 h) and at different time intervals (6, 9, 12, 18, 24, 36, 42, 48, 60, 72, and 96 h) after treatment. The results showed that the limit of detection(LOD) and limit of quantitation(LOQ) of UPLC-MS/MS were 0.5 ng/mL and 1.0 ng/mL, respectively. The residues of RIF in the milk samples from 6 h to 96 h after administration were not detected, which were lower than LOQ (1.0 ng/mL) and lower than maximum residue limits(MRLs) (60 ng/mL in milk). This study indicated that administration of RIF by uterine routine has a minimal distribution rate into the milk, and the RIF intrauterine infusion could be used in lactating cows with zero milk-withdrawal period. © Published under licence by IOP Publishing Ltd.