Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:1428aAnas

I also saw the wedding feast of Zainab, and he (the Holy Prophet) served bread and meat to the people, and made them eat to their heart's content, and he (the Holy Prophet) sent me to call people, and as he was free (from the ceremony) he stood up and I followed him. Two persons were left and they were busy in talking and did not get out (of the apartment). He (the Holy Prophet) then proceeded towards (the apartments of) his wives. He greeted with as-Salamu 'alaikum to every one of them and said: Members of the household, how are you? They said: Messenger of Allah, we are in good state 'How do you find your family? He would say: In good state. When he was free from (this work of exchanging greetings) he came back, and I also came back along with him. And as he reached the door, (he found) that the two men were still busy in talking. And when they saw him having returned, they stood up and went out; and by Allah! I do not know whether I had informed him, or there was a revelation to him (to the affect) that they had gone. He (the Holy Prophet) then came back and I also returned along with him, and as he put his step on the threshold of his door he hung a curtain between me and him, and (it was on this occasion) that Allah revealed this verse: (" O you who believe), do not enter the houses of the Prophet unless permission is given to 'you" (xxxiii. 53).  

مسلم:١٤٢٨aقَالَ أَنَسٌ

وَشَهِدْتُ وَلِيمَةَ زَيْنَبَ فَأَشْبَعَ النَّاسَ خُبْزًا وَلَحْمًا وَكَانَ يَبْعَثُنِي فَأَدْعُو النَّاسَ فَلَمَّا فَرَغَ قَامَ وَتَبِعْتُهُ فَتَخَلَّفَ رَجُلاَنِ اسْتَأْنَسَ بِهِمَا الْحَدِيثُ لَمْ يَخْرُجَا فَجَعَلَ يَمُرُّ عَلَى نِسَائِهِ فَيُسَلِّمُ عَلَى كُلِّ وَاحِدَةٍ مِنْهُنَّ سَلاَمٌ عَلَيْكُمْ كَيْفَ أَنْتُمْ يَا أَهْلَ الْبَيْتِ فَيَقُولُونَ بِخَيْرٍ يَا رَسُولَ اللَّهِ كَيْفَ وَجَدْتَ أَهْلَكَ فَيَقُولُ بِخَيْرٍ فَلَمَّا فَرَغَ رَجَعَ وَرَجَعْتُ مَعَهُ فَلَمَّا بَلَغَ الْبَابَ إِذَا هُوَ بِالرَّجُلَيْنِ قَدِ اسْتَأْنَسَ بِهِمَا الْحَدِيثُ فَلَمَّا رَأَيَاهُ قَدْ رَجَعَ قَامَا فَخَرَجَا فَوَاللَّهِ مَا أَدْرِي أَنَا أَخْبَرْتُهُ أَمْ أُنْزِلَ عَلَيْهِ الْوَحْىُ بِأَنَّهُمَا قَدْ خَرَجَا فَرَجَعَ وَرَجَعْتُ مَعَهُ فَلَمَّا وَضَعَ رِجْلَهُ فِي أُسْكُفَّةِ الْبَابِ أَرْخَى الْحِجَابَ بَيْنِي وَبَيْنَهُ وَأَنْزَلَ اللَّهُ تَعَالَى هَذِهِ الآيَةَ { لاَ تَدْخُلُوا بُيُوتَ النَّبِيِّ إِلاَّ أَنْ يُؤْذَنَ لَكُمْ} الآيَةَ  


See similar narrations below:

Collected by Bayhaqī
bayhaqi:14753[Chain 1] Abū ʿAbdullāh al-Ḥāfiẓ > Abū al-Ḥasan ʿAlī b. Muḥammad b. Sakhtawayh > Mūsá b. al-Ḥasan And Muḥammad b. Ghālib And Muḥammad b. ʿAlī b. Buṭḥān > ʿAffān [Chain 2] Abū ʿAbdullāh > Aḥmad b. Sahl al-Bukhārī > Ṣāliḥ b. Muḥammad b. Ḥabīb al-Ḥāfiẓ > ʿAbdullāh b. Abū Shaybah And Zuhayr b. Ḥarb > ʿAffān > Ḥammād b. Salamah > Thābit > Anas ؓ > Shahidt

I also saw the wedding feast of Zainab, and he (the Holy Prophet) served bread and meat to the people, and made them eat to their heart's content, and he (the Holy Prophet) sent me to call people, and as he was free (from the ceremony) he stood up and I followed him. Two persons were left and they were busy in talking and did not get out (of the apartment). He (the Holy Prophet) then proceeded towards (the apartments of) his wives. He greeted with as-Salamu 'alaikum to every one of them and said: Members of the household, how are you? They said: Messenger of Allah, we are in good state 'How do you find your family? He would say: In good state. When he was free from (this work of exchanging greetings) he came back, and I also came back along with him. And as he reached the door, (he found) that the two men were still busy in talking. And when they saw him having returned, they stood up and went out; and by Allah! I do not know whether I had informed him, or there was a revelation to him (to the affect) that they had gone. He (the Holy Prophet) then came back and I also returned along with him, and as he put his step on the threshold of his door he hung a curtain between me and him, and (it was on this occasion) that Allah revealed this verse: (" O you who believe), do not enter the houses of the Prophet unless permission is given to 'you" (xxxiii. 53). (Using translation from Muslim 1428a)   

البيهقي:١٤٧٥٣أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ نا أَبُو الْحَسَنِ عَلِيُّ بْنُ مُحَمَّدِ بْنِ سَخْتَوَيْهِ نا مُوسَى بْنُ الْحَسَنِ وَمُحَمَّدُ بْنُ غَالِبٍ وَمُحَمَّدُ بْنُ عَلِيِّ بْنِ بُطْحَانَ قَالُوا نا عَفَّانُ ح وَأَخْبَرَنَا أَبُو عَبْدِ اللهِ أَخْبَرَنِي أَحْمَدُ بْنُ سَهْلٍ الْبُخَارِيُّ نا صَالِحُ بْنُ مُحَمَّدِ بْنِ حَبِيبٍ الْحَافِظُ نا عَبْدُ اللهِ بْنُ أَبِي شَيْبَةَ وَزُهَيْرُ بْنُ حَرْبٍ قَالَا نا عَفَّانُ نا حَمَّادُ بْنُ سَلَمَةَ أنا ثَابِتٌ عَنْ أَنَسٍ ؓ قَالَ شَهِدْتُ

وَلِيمَةَ زَيْنَبَ ؓ فَأُشْبِعَ النَّاسُ خُبْزًا وَلَحْمًا وَكَانَ يَبْعَثُنِي فَأَدْعُو النَّاسَ فَلَمَّا فَرَغَ قَامَ وَتَبِعْتُهُ وَتَخَلَّفَ رَجُلَانِ اسْتَأْنَسَ بِهِمَا الْحَدِيثَ لَمْ يَخْرُجَا فَجَعَلَ يَمُرُّ بِنِسَائِهِ فَيُسَلِّمُ عَلَى كُلِّ وَاحِدَةٍ مِنْهُنَّ سَلَامٌ عَلَيْكُنَّ أَهْلَ الْبَيْتِ كَيْفَ أَنْتُنَّ؟ فَيَقُلْنَ بِخَيْرٍ يَا رَسُولَ اللهِ كَيْفَ وَجَدْتَ أَهْلَكَ؟ فَيَقُولُ بِخَيْرٍ فَلَمَّا فَرَغَ رَجَعَ فَرَجَعْتُ مَعَهُ فَلَمَّا بَلَغَ الْبَابَ إِذَا هُوَ بِالرَّجُلَيْنِ اسْتَأْنَسَ بِهِمَا الْحَدِيثَ فَلَمَّا رَأَيَاهُ قَدْ رَجَعَ قَامَا فَخَرَجَا فَوَاللهِ مَا أَدْرِي أَنَا أَخْبَرْتُهُ أَوْ نَزَلَ عَلَيْهِ الْوَحْيُ بِأَنَّهُمَا قَدْ خَرَجَا فَرَجَعَ وَرَجَعْتُ مَعَهُ فَلَمَّا وَضَعَ رِجْلَيْهِ فِي أُسْكُفَّةِ الْبَابِ أَرْخَى الْحِجَابَ بَيْنِي وَبَيْنَهُ وَأُنْزِلَتْ عَلَيْهِ هَذِهِ الْآيَةُ {لَا تَدْخُلُوا بُيُوتَ النَّبِيِّ} [الأحزاب 53] الْآيَةَ  

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ أَبِي بَكْرِ بْنِ أَبِي شَيْبَةَ