Lice infested my head while I was with the Messenger of Allah ﷺ during the year of Hudaybiyah, to the point that I feared for my eyesight. So Allah revealed concerning me, "And whoever among you is ill or has an ailment of the head" [Baqarah 2:196].The Messenger of Allah ﷺ called me and said, "Shave your head, then either fast three days, or feed six poor people with a faraq of raisins, or sacrifice a sheep."So I shaved my head and then offered the sacrifice.
حدثنا محمد بن منصور حدثنا يعقوب حدثني أبي عن ابن إسحق حدثني أبان يعني ابن صالح عن الحكم بن عتيبة عن عبد الرحمن بن أبي ليلى
أصابني هوام في رأسي وأنا مع رسول الله ﷺ عام الحديبية حتى تخوفت على بصري فأنزل الله سبحانه وتعالى في {فمن كان منكم مريضا أو به أذى من رأسه} الآية فدعاني رسول الله ﷺ فقال لي احلق رأسك وصم ثلاثة أيام أو أطعم ستة مساكين فرقا من زبيب أو انسك شاة فحلقت رأسي ثم نسكت
Its chain of transmission is daif. Ibn Abdul-Barr recorded it in Tamhid (2/234, 235) from the hadith of Abu Dawud through this route, and the hadith has corroborating narrations. Hakam bin Utayba is a mudallis narrator, and he narrated it using "an" (indicating possible concealment in the chain).