The Messenger of Allah ﷺ said, "Prayer is not to be performed in the resting places of camels, but it may be performed in the folds of sheep."
أن رسول الله ﷺ قال: لا يصلى في أعطان الإبل، ويصلى في مراح الغنم.
Ibn Majah (770) narrated it from Abu Bakr bin Abu Shayba, and it also appears in his Musannaf (1/385), from Zayd bin Hubab, who said, Abdul-Malik bin Rabi bin Sabra bin Mabad Juhani narrated to us, from his father, from his grandfather, and he related it. Imam Ahmad (15341) also narrated it from Zayd bin Hubab in the same manner. Its chain is hasan, for Abdul-Malik bin Rabi is hasan al-hadith, and although Ibn Main declared him daif, Ajli affirmed his reliability, and Dhahabi said, "Truthful, if Allah wills," and Muslim included him as a corroborating narrator.On this subject there is also a narration from Abdullah bin Mughafal Muzani, who said that the Messenger of Allah ﷺ said, "Pray in the resting places of sheep, and do not pray in the resting places of camels, for they were created from devils." Ibn Majah (769) narrated it, and this is his wording, and Nasai (735) narrated it in abridged form, both from the hadith of Hasan, from Abdullah bin Mughafal Muzani. It contains Hasan, who is a mudallis and narrated here with an ambiguous form of transmission (anana). Ahmad (20571), Bayhaqi (2/449), Baghawi (504), Ibn Hibban (1702), and others narrated it through his route as well. Nevertheless, a narration of this kind is acceptable as a supporting witness.As for his saying "aatan al-ibil" (the resting place of camels), it means the place where camels kneel down. It is said, "The camels aţanat aţunan," meaning they knelt near the water after drinking from it. Ibn Athir said in Jami al-Usul (5/470), "The aatan of camels are their resting places around water, where they settle to drink their fill after having drunk lightly before. The reason for the prohibition against praying in the resting places of camels is not due to impurity, since impurity is likewise found in the resting places of sheep. Rather, it is because camels crowd together at the watering place, herd by herd, and when they finish drinking they raise their heads, and there is no guarantee that they will not scatter and bolt in that spot, thereby harming the one praying nearby." Al-marah is the place where animals spend the night.Baghawi said, "The prohibition against praying in the resting places of camels is due to the skittishness found in them, for there is no guarantee that they will not bolt and thereby distract the heart of the one praying, or ruin his prayer for him. If someone were to pray there while the place itself is pure, his prayer would still be valid according to the majority of scholars of knowledge." He then said, "Malik, Ahmad, Ishaq, and Abu Thawr held that prayer in the resting places of camels is invalid without exception, based on the apparent meaning of the hadith." Sharh al-Sunnah (2/404, 405).