Sayyiduna Amr bin Kharijah (may Allah be pleased with him) said: I was present with the Messenger of Allah (peace and blessings be upon him) when he (peace and blessings be upon him) was delivering a sermon on his mount at Mina. He (peace and blessings be upon him) was holding its halter while it was chewing its cud, and its saliva was flowing between my shoulders. The Prophet (peace and blessings be upon him) said: "O people! Allah has allotted to every person his share of the inheritance, so now no bequest is permissible for an heir. Listen! The child belongs to the (lawful) bed, and for the fornicator is the stone. Whoever attributes himself to someone other than his father, or attributes himself to someone other than his patrons out of aversion to them, upon him is the curse of Allah, the angels and all people."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14137