Fasting the first Nine Days of Dhul-Hijjah is a Sunnah
Bismillaah Al-Hamdulillaah wa salatu wa salaamu ‘ala rasulullaah , Amma ba’d
Hunaydah ibn Khaalid narrated upon the authority of his wife who said, “Some of the wives of the Prophet (salallaahu ‘alaihiwasallam) told me that the Prophet (salallaahu ‘alaihiwasallam) used to fast the Day of ‘Aashoorah, the first nine days of Dhul-Hijjah, and three days out of every month*.” (Imam Ahmad, An-Nasaaee)
*- 13th, 14th, and 15th every month
Commentary: Imam An-Nawwawee (rahimahullaah) said with reference to fasting the first nine days of Dhul-Hijjah,
quote: “It is extremely preferable to do so.”
A questioner asked Shaikh al-’Uthaimeen (rahimahullaah) the following question:
Question: Oh Shaikh, are there any authentic ahadith that mention fasting the first [nine] days of Dhul-Hijjah?
Answer by Shaikh al-’Uthaimeen:
“Fasting the first [nine] of Dhul-Hijjah is from the righteous actions without doubt.
And the Prophet salallaahu ‘alaihi wasallam said, “There are not any days in which righteous actions are done that are more beloved to Allaah than these ten days.” They said, “Oh Messenger of Allaah, not even jihad in Allaah’s cause?” He said, “Not even jihad in Allaah’s cause, except for a man who left out with his self and his wealth, and he did not return with either.”
So fasting is included in the general context of this hadith. And there appears a hadith stating that the Messenger of Allaah salallaahu ‘alaihi wasallam used to fast the first ten of Dhul Hijjah, not counting the ‘Eid [in other words, the first nine days of Dhul-Hijjah].
And Imam Ahmad ibn Hanbal rahimahullaah takes this position and it is authentic. Fasting in the first ten [of Dhul-Hijjah, excluding the 'Eid] is sunnah. Yes.”