Allah says in Surah Al-Mai’dah (interpretation):
“O you who believe! Ask not about things which, if made plain to you, may cause you trouble. But if you ask about them while the Quran is being revealed, they will be made plain to you. Allah has forgiven that, and Allah is Oft-Forgiving, Most Forbearing.” — Quran 5:101
This verse forbade the believers to ask the Prophet about matters concerning which Allah had not said anything in His Book and had not said anything concerning them; splitting hairs and asking too many details about them might lead to them being prohibited, which would cause them hardship. It also forbade them to ask about things that were hidden from them and if they came to know about them it would upset them, such as how sound their attribution to their fathers was. And that indeed happened.
Al-Bukhaari (540) and Muslim (2359) narrated from Anas ibn Maalik that the Messenger of Allah came out when the sun had passed its zenith and led them in praying Dhuhr. Then he stood on the minbar and spoke of the Hour, and said that momentous events would occur during it. Then he said: “Whoever would like to ask about anything, let him ask; you will not ask me about anything but I will tell you about it, so long as I am standing here.” The people wept a great deal, and he kept saying: “Ask me.”
‘Abdullah ibn Hudhaafah as-Sahmi stood up and said: “Who is my father?” He said: “Your father is Hudhaafah.” Then he kept saying, “Ask me.” Then ‘Umar knelt up and said: “We are pleased with Allah as our Lord, Islam as our religion, and Muhammad as our Messenger.” [The Messenger of Allah] fell silent, then he said: “Paradise and Hell were shown to me just now, on this wall, and I have never seen anything as good (as what I saw in Paradise) or anything as evil (as what I saw in Hell).”
A number of things are known from this:
Firstly, the prohibition mentioned in the verse applies specifically to the time of the Prophet (blessings and peace of Allah be upon him), which was the time when Revelation was still coming down, unlike times that came after that. Hence this does not mean that we should not seek Islamic knowledge and learn that which will benefit us or that we need to know with regard to matters of this life and the hereafter.
Secondly, the things that they were forbidden to ask about were:
- Things that had no bearing on their actions and were of no benefit in religious terms
- Things that Islam said nothing about, out of mercy to people, not out of forgetfulness, because asking too many questions about that could lead to them being forbidden, which would cause hardship for people.
- Al-Bukhaari (6745) and Muslim (4349) narrated that Sa‘d ibn Abi Waqqaas (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “One of the worst sins a Muslim could commit is asking about something that was not prohibited to the Muslims, but it became prohibited to them because of his asking.”
- Things that were unknown to those who asked about them, which if they were made plain to them would cause them trouble, as we have seen above in the hadeeth of ‘Abdullah ibn Hudhaafah.
Thirdly, with regard to matters that are connected to the explanation of a shariah ruling, Allah has instructed us to ask about them, as He says (interpretation): “So ask those who possess knowledge if you do not know.” — Quran 16:43