Short answer
Yes. In the Hanafi school fasting the first nine days of Dhul Hijjah is mustahabb, and the 9th, the Day of Arafah, is the most emphasised. You may fast all nine or only some. The 10th is Eid al-Adha, when fasting is not allowed. The four schools agree that these fasts are recommended.
Fasting 1 to 9 Dhul Hijjah is mustahabb, the Day of Arafah most of all for those not on Hajj. Fasting on Eid al-Adha and the three days after it is makruh tahrimi.
The four schools agree on this.
Explanation
The Prophet ﷺ said there are no days in which righteous deeds are more beloved to Allah than these ten days. Fasting is one of the best deeds, so the scholars recommend it in the first nine. The Quran swears by ten nights, which many commentators explain as these days.
Did the Prophet ﷺ fast them? Two reports appear to differ. Aisha said she never saw him fasting in the ten. One of his other wives, reported by Hunaydah ibn Khalid, said he used to fast the nine days of Dhul Hijjah. The scholars reconcile them: Aisha reported what she saw, and the other wife reported what she saw; he may have fasted some years and not others, or on days when he was not with Aisha. Even without a firm report, the general hadith on the virtue of good deeds in these days is enough to make fasting them recommended.
- Fast all nine days if you can, or any of them.
- Do not miss the Day of Arafah. See fasting on the Day of Arafah.
- Do not fast on the 10th (Eid) or the 11th to 13th. See fasting on Eid.
- If you are giving qurbani, the sunnah of not cutting hair and nails also applies.
Fill the days with takbir, dhikr and charity too. For the dates and a day-by-day plan, see the first 10 days of Dhul Hijjah.
The evidence
Quran, Surah Al-Fajr 89:2
وَلَيَالٍ عَشْرٍۢ ﴿٢﴾
And [by] ten nights
Many commentators explain the ten nights as the first ten of Dhul Hijjah.
Sunan Abi Dawud 2438
Grading to be checked... ما من أيام العمل الصالح فيها أحب إلى الله من هذه الأيام ...
"There are no days in which righteous deeds are more beloved to Allah than these days, meaning the ten days."
The general virtue of good deeds, including fasting, in these days.
Sunan Abi Dawud 2437
Grading to be checked... كان رسول الله صلى الله عليه وسلم يصوم تسع ذي الحجة ...
"The Messenger of Allah used to fast the nine days of Dhul Hijjah."
A report from one of his wives that he fasted these days.
Sahih Muslim 1176
Sahih... ما رأيت رسول الله صلى الله عليه وسلم صائما في العشر قط ...
"I never saw the Messenger of Allah fasting in the ten."
Aisha's report, which the scholars reconcile with the one before it.
Where the ruling is recorded
- al-Fatawa al-Hindiyya, Kitab al-Sawm, chapter on what is desirable and disliked in fasting. Fasting the days of Dhul Hijjah before Eid is among the desirable fasts.
- al-Majmu' (Nawawi), Kitab al-Siyam, chapter on voluntary fasting. Nawawi's reconciliation of Aisha's report with the recommendation to fast the nine days.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.