Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates that the Messenger of Allah (peace and blessings be upon him) said: "There is no musa'ah (claiming lineage on the basis of fornication) in Islam. Whoever committed musa'ah in the Jahiliyyah, I have attached him to his 'asabah (paternal kin). And whoever claims a child born outside a lawful marriage, he will neither inherit nor be inherited from."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12385