Sahih Muslim , Hadith 12

It is reported on the authority of Anas b. Malik that he said: We were forbidden that we should ask anything (without the genuine need) from the Holy Prophet. It, therefore, pleased us that an intelligent person from the dwellers of the desert should come and asked him (the Holy Prophet) and we should listen to it. A man from the dwellers of the desert came (to the Holy Prophet) and said: Muhammad, your messenger came to us and told us your assertion that verily Allah had sent you (as a prophet). He (the Holy Prophet) remarked: He told the truth. He (the bedouin) said: Who created the heaven? He (the Holy Prophet) replied: Allah. He (the bedouin again) said: Who created the earth? He (the Holy Prophet) replied: Allah. He (the bedouin again) said: Who raised these mountains and who created in them whatever is created there? He (the Holy Prophet) replied: Allah. Upon this he (the bedouin) remarked: By Him Who created the heaven and created the earth and raised mountains thereupon, has Allah (in fact) sent you? He (the Holy Prophet) said: Yes. He (the bedouin) said: Your messenger also told us that five prayers (had been made) obligatory for us during the day and the night. He (the Holy Prophet) remarked: He told you the truth. He (the bedouin) said: By Him Who sent you, is it Allah Who ordered you about this (i. e. prayers)? He (the Holy Prophet) said: Yes. He (the bedouin) said: Your messenger told us that Zakat had been made obligatory in our riches. He (the Holy Prophet) said. He has told the truth. He (the bedouin) said: By Him Who sent you (as a prophet), is it Allah Who ordered you about it (Zakat)? He (the Holy Prophet) said: Yes. He (the bedouin) said: Your messenger told us that it had been made obligatory for us to fast every year during the month of Ramadan. He (the Holy Prophet) said: He has told the truth. He (the bedouin) said: By Him Who sent you (as a prophet), is it Allah Who ordered you about it (the fasts of Ramadan)? He (the Holy Prophet) said: Yes. He (the bedouin) said: Your messenger also told us that pilgrimage (Hajj) to the House (of Ka'bah) had been made obligatory for him who is able to undertake the journey to it. He (the Holy Prophet) said: Yes. The narrator said that he (the bedouin) set off (at the conclusion of this answer, but at the time of his departure) remarked: 'By Him Who sent you with the Truth, I would neither make any addition to them nor would I diminish anything out of them. Upon this the Prophet remarked: If he were true (to what he said) he must enter Paradise.

حَدَّثَنِي عَمْرُو بْنُ مُحَمَّدِ بْنِ بُكَيْرٍ النَّاقِدُ، حَدَّثَنَا هَاشِمُ بْنُ الْقَاسِمِ أَبُو النَّضْرِ، حَدَّثَنَا سُلَيْمَانُ بْنُ الْمُغِيرَةِ، عَنْ ثَابِتٍ، عَنْ أَنَسِ بْنِ مَالِكٍ، قَالَ نُهِينَا أَنْ نَسْأَلَ، رَسُولَ اللَّهِ صلى الله عليه وسلم عَنْ شَىْءٍ فَكَانَ يُعْجِبُنَا أَنْ يَجِيءَ الرَّجُلُ مِنْ أَهْلِ الْبَادِيَةِ الْعَاقِلُ فَيَسْأَلَهُ وَنَحْنُ نَسْمَعُ فَجَاءَ رَجُلٌ مِنْ أَهْلِ الْبَادِيَةِ فَقَالَ يَا مُحَمَّدُ أَتَانَا رَسُولُكَ فَزَعَمَ لَنَا أَنَّكَ تَزْعُمُ أَنَّ اللَّهَ أَرْسَلَكَ قَالَ ‏"‏ صَدَقَ ‏"‏ ‏.‏ قَالَ فَمَنْ خَلَقَ السَّمَاءَ قَالَ ‏"‏ اللَّهُ ‏"‏ ‏.‏ قَالَ فَمَنْ خَلَقَ الأَرْضَ قَالَ ‏"‏ اللَّهُ ‏"‏ ‏.‏ قَالَ فَمَنْ نَصَبَ هَذِهِ الْجِبَالَ وَجَعَلَ فِيهَا مَا جَعَلَ ‏.‏ قَالَ ‏"‏ اللَّهُ ‏"‏ ‏.‏ قَالَ فَبِالَّذِي خَلَقَ السَّمَاءَ وَخَلَقَ الأَرْضَ وَنَصَبَ هَذِهِ الْجِبَالَ آللَّهُ أَرْسَلَكَ قَالَ ‏"‏ نَعَمْ ‏"‏ ‏.‏ قَالَ وَزَعَمَ رَسُولُكَ أَنَّ عَلَيْنَا خَمْسَ صَلَوَاتٍ فِي يَوْمِنَا وَلَيْلَتِنَا ‏.‏ قَالَ ‏"‏ صَدَقَ ‏"‏ ‏.‏ قَالَ فَبِالَّذِي أَرْسَلَكَ آللَّهُ أَمْرَكَ بِهَذَا قَالَ ‏"‏ نَعَمْ ‏"‏ ‏.‏ قَالَ وَزَعَمَ رَسُولُكَ أَنَّ عَلَيْنَا زَكَاةً فِي أَمْوَالِنَا ‏.‏ قَالَ ‏"‏ صَدَقَ ‏"‏ ‏.‏ قَالَ فَبِالَّذِي أَرْسَلَكَ آللَّهُ أَمْرَكَ بِهَذَا قَالَ ‏"‏ نَعَمْ ‏"‏ ‏.‏ قَالَ وَزَعَمَ رَسُولُكَ أَنَّ عَلَيْنَا صَوْمَ شَهْرِ رَمَضَانَ فِي سَنَتِنَا ‏.‏ قَالَ ‏"‏ صَدَقَ ‏"‏ ‏.‏ قَالَ فَبِالَّذِي أَرْسَلَكَ آللَّهُ أَمَرَكَ بِهَذَا قَالَ ‏"‏ نَعَمْ ‏"‏ ‏.‏ قَالَ وَزَعَمَ رَسُولُكَ أَنَّ عَلَيْنَا حَجَّ الْبَيْتِ مَنِ اسْتَطَاعَ إِلَيْهِ سَبِيلاً ‏.‏ قَالَ ‏"‏ صَدَقَ ‏"‏ ‏.‏ قَالَ ثُمَّ وَلَّى ‏.‏ قَالَ وَالَّذِي بَعَثَكَ بِالْحَقِّ لاَ أَزِيدُ عَلَيْهِنَّ وَلاَ أَنْقُصُ مِنْهُنَّ ‏.‏ فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ لَئِنْ صَدَقَ لَيَدْخُلَنَّ الْجَنَّةَ ‏"‏ ‏.‏

sunnah.com

It is narrated on the authority of Thabit that Anas said: We were forbidden in the Holy Qur'an that we should ask about anything from the Messenger of Allah and then Anas reported the hadith in similar words.

حَدَّثَنِي عَبْدُ اللَّهِ بْنُ هَاشِمٍ الْعَبْدِيُّ، حَدَّثَنَا بَهْزٌ، حَدَّثَنَا سُلَيْمَانُ بْنُ الْمُغِيرَةِ، عَنْ ثَابِتٍ، قَالَ قَالَ أَنَسٌ كُنَّا نُهِينَا فِي الْقُرْآنِ أَنْ نَسْأَلَ رَسُولَ اللَّهِ صلى الله عليه وسلم عَنْ شَىْءٍ ‏.‏ وَسَاقَ الْحَدِيثَ بِمِثْلِهِ ‏.‏

sunnah.com