It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "There is no earning through a slave woman's prostitution in Islam. Whoever earned this way in the Jahiliyyah, and then that woman bore a boy, his lineage will be joined to his master. And whoever claims a child without marriage, the child will not inherit from him, nor will he inherit from the child."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الفرائض / 12503