It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The child will be attributed to the one on whose bed he was born, while for the adulterer (if the case is proven) there are stones."
Hadith Referenceالسنن المأثورة / باب ما جاء في فدية الأذى / 490
Hadith Takhrijصحیح مسلم، الرضاع، باب الولد للفراش، رقم: 1458۔