Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said: Whoever among you has knowledge should make it apparent, and whoever does not have knowledge should say about what he does not know: «لا أعلم» (that is, "I do not know"), because if a scholar is asked about something he does not know, he should say «الله أعلم», just as Allah Almighty said to His Messenger (peace and blessings be upon him): "Say: I do not ask you for any reward for it, nor am I one of those who pretend." [سورة ص: 86/38]
Hadith Referenceسنن دارمي / مقدمه / 179
Hadith Gradingتحقیق (حسین سلیم أسد الدارانی):إسناده صحيح والحديث متفق عليه، [مكتبه الشامله نمبر: 179]
Hadith Takhrijاس روایت کی سند صحیح ہے۔ دیکھئے: [بخاري 4774] ، [مسند الحميدي 116] و [صحيح ابن حبان 4764]
Brief Explanation
(Commentary on Hadiths 176 to 179)
In this narration, there is an exhortation to refrain from issuing religious verdicts (fatwa) without knowledge, and encouragement to admit to one's lack of knowledge and shortcomings. Allah Ta'ala says: «﴿وَمَاأُوتِيتُمْمِنَالْعِلْمِإِلَّاقَلِيلًا﴾ [الاسراء : 85]» Translation: "You have been given but little knowledge."
Furthermore, the pious predecessors (aslaf kiram) have considered saying «لا أعلم» ("I do not know") to be half of knowledge, and to feign knowledge or to display it without actually possessing it is affectation (takalluf). In the noble verse, this has been prohibited, and it has been stated: «﴿قُلْمَاأَسْأَلُكُمْعَلَيْهِمِنْأَجْرٍوَمَاأَنَامِنَالْمُتَكَلِّفِينَ﴾ [سورة ص : 86]»