Sahih Muslim , Book 8, Hadith 3436 (USC-MSA) ⓘ
A hadith like this is narrated on the authority of Ibn 'Uyaiyna and Ma'mar (and the words are): The child is attributed to him on whose bed he is born; but they did not mention this:" For a fornicator there is stoning."
حَدَّثَنَا سَعِيدُ بْنُ مَنْصُورٍ، وَأَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ وَعَمْرٌو النَّاقِدُ قَالُوا حَدَّثَنَا سُفْيَانُ، بْنُ عُيَيْنَةَ ح وَحَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ، أَخْبَرَنَا عَبْدُ الرَّزَّاقِ، أَخْبَرَنَا مَعْمَرٌ، كِلاَهُمَا عَنِ الزُّهْرِيِّ، بِهَذَا الإِسْنَادِ نَحْوَهُ . غَيْرَ أَنَّ مَعْمَرًا وَابْنَ عُيَيْنَةَ فِي حَدِيثِهِمَا " الْوَلَدُ لِلْفِرَاشِ " . وَلَمْ يَذْكُرَا " وَلِلْعَاهِرِ الْحَجَرُ " .
also referenced under: Book 17, Hadith 47 (In-Book) & Hadith 1457 (Reference)