Escherichia coli (E. coli) is a gram-negative environmental micro-organism- which causes intramammary infections in mammals, In addition, to cause food poisoning in human. Four hundred samples were obtained from various areas of the dairy farm . Fifty samples from each of bedding, soils, feces, feed, milk, water, workers hands, and flies were randomly collected from different regions located around Nineveh Governorate between September 2020 and January 2021. E. coli isolates were identifed using the classical methods based on the morphological and biochemical methods for the detection the E. coli isolates and PCR had been used to detect the uidA gene in it. The results of our study revealed that out of 400 samples collected from different dairy herds, 140 (35%) of E. coli were positive. The percentage of E. coli isolated from flies, bedding, feces, milk, soils, feed, water, and worker's hands was 76% (38/50), 46% (23/50), 38% (19/50), 34% (17/50), 28% (14/50), 28% (14/50), 18% (9/50), and 12% (6/50), respectively. All the positive E. coli isolates have been possessing the uidA gene which is the species-specific gene .The results of classical methods had concurred with the results of the PCR test. The current study showed that milk, workers' hand, and flies played an important role to spread E. coli in the dairy farms. The PCR technique is a rapid method that helps to give the suitable drugs in the treatment of the cattle suffered from mastitis and prevent E. coli from distribution among the dairy herds.