The primary cause of contagious ecthyma is the orf virus, the parapoxvirus prototype. It is a viral problem observed in goat and sheep flocks in Iran, causing economic loss. Orf is a zoonosis with little epidemiological investigation present in Iran. The current research aims at determining the status of this virus, and a PCR was used as a confirmatory instrument. We sampled 668 goats and sheep and various breeding systems. Besides, the orf prevalence was studied, and vaccination efficacy was determined. Moreover, the potential risk factors surveyed for infection with ecthyma were identified. Samples were taken from goat and sheep flocks in the present cross-sectional research, and PCR was used for testing orf DNA. A checklist including animals’ general information was completed. Data were analyzed using univariate tests (chi-square and t-tests) and multivariable binary logistic regression analysis. Three hundred one (45%) goats and sheep detected orf DNA. The age of 70% of positive cases was below one month. Ecthyma infection was significantly higher in imported breeds (87.3%) than indigenous (39.3%). Ninety-six percent of infected goats and sheep in the present work were not vaccinated against ecthyma. The high prevalence of the orf virus was confirmed among goat and sheep flocks in Iran. It is necessary to train ranchers regarding sanitary actions, quarantine, and application of orf vaccination plans.