It was narrated from 'Umar that:
the Messenger of Allah ruled that the child belonged to the bed.
Reference: 2005English reference: Vol. 3, Book 9, Hadith 2005Arabic reference: Book 9, Hadith 2083In-book reference: Book 9, Hadith 161Grade: Sahih (Darussalam)Read this hadith from Darussalam Collection
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنْ عُبَيْدِ اللَّهِ بْنِ أَبِي يَزِيدَ، عَنْ أَبِيهِ، عَنْ عُمَرَ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَضَى بِالْوَلَدِ لِلْفِرَاشِ .