It is narrated from Sayyiduna Amr bin Kharijah (may Allah be pleased with him); he said: I was holding the reins of the she-camel of the Messenger of Allah (peace and blessings be upon him) while she was chewing her cud, and her saliva was flowing between my shoulders. In that state I heard him (peace and blessings be upon him) say: "Listen! Allah, the Mighty and Majestic, has given every rightful claimant his due right. Listen! No bequest is permissible for an heir, and the child belongs to the (lawful) bed. Whoever attributes himself to someone other than his father and attributes himself to someone other than his patrons, upon him is the curse of Allah, the angels and all people; neither a voluntary nor an obligatory deed will be accepted from him."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14136