Sahih Muslim Book 42, Hadith Number 7105.

Chapter : Do not enter but Weepingly the Habitations of those who Committed Atrocities upon themselves.

Abdullah b. ‘Umar reported that the people encamped along with Allah’s Messenger (may peace be upon him) in the valley of Hijr, the habitations of Thamud, and they quenched their thirst from the wells thereof and kneaded the flour with it. Thereupon Allah’s Messenger (may peace be upon him) commanded that the water collected for drinking should be spilt and the flour should be given to the camels and commanded them that the water for drinking should be taken from that well where the she-camel (of Hadrat Salih) used to come.