Sahih Muslim Book 7, Hadith Number 2732.

Chapter : It is permissible to shave the head in the state of Ihram if there is a trouble, and expiation becomes obligatory for shaving.

Ka’b b. ‘Ujra (Allah be pleased with him) reported: The Messenger of Allah (may peace be upon him) came to me on the occasion of Hudaibiya and I was kindling fire under my cooking pot and lice were creeping on my face. Thereupon he (the Holy Prophet) said: Do the vermin’s harm your head? I said: Yes. He said: Get your head shaved and (in lieu of it) observe fasts for three days or feed six needy persons, or offer sacrifice (of an animal). Ayyub said: I do not know with what (type of expiation) did he commence (the statement).