حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ الرَّحِيمِ، أَخْبَرَنَا رَوْحُ بْنُ عُبَادَةَ، حَدَّثَنَا شُعْبَةُ، أَخْبَرَنِي مُوسَى بْنُ أَنَسٍ، قَالَ سَمِعْتُ أَنَسَ بْنَ مَالِكٍ، قَالَ قَالَ رَجُلٌ يَا نَبِيَّ اللَّهِ مَنْ أَبِي قَالَ أَبُوكَ فُلاَنٌ ". وَنَزَلَتْ {يَا أَيُّهَا الَّذِينَ آمَنُوا لاَ تَسْأَلُوا عَنْ أَشْيَاءَ} الآيَةَ."
Narrated Anas bin Malik:
A man said, "O Allah's Prophet! Who is my father?" The Prophet (ﷺ) said, "Your father is so-and-so." And then the Divine Verse:-- 'O you who believe! Ask not questions about things..(5:101)
Reference: Sahih al-Bukhari 7295
In-book : Book 96, Hadith 26
USC-MSA web (English) : Vol. 9, Book 92, Hadith 398 (deprecated)