Hudhayn bin Mundhir Qashi narrated that I was present with Sayyiduna Uthman bin Affan (may Allah be pleased with him) when Walid bin Uqbah (the half-brother of Sayyiduna Uthman, may Allah be pleased with him) was brought. Sayyiduna Ali (may Allah be pleased with him) said: The Noble Prophet (peace and blessings be upon him) gave forty lashes to the one who drank alcohol, and Sayyiduna Abu Bakr (may Allah be pleased with him) also gave forty lashes, and Sayyiduna Umar (may Allah be pleased with him) gave eighty lashes, and all are Sunnah.
Hadith Referenceسنن دارمي / من كتاب الاحدود / 2349
The punishment for one who drinks alcohol or becomes intoxicated is not mentioned in the Noble Qur’an. It is known that drinking alcohol is forbidden; it is the mother of all evils, and in a state of intoxication, a person may commit vile and unforgivable crimes. Therefore, Islam has closed this door altogether. Now, if someone does drink, then he must certainly be punished, and the punishment that the Noble Prophet sallallahu alayhi wa sallam administered to the drinker—such as with a stick, etc.—was also carried out by Sayyiduna Abu Bakr radi Allahu anhu, that is, forty lashes were given. When people began to drink in greater numbers, the Commander of the Faithful, Sayyiduna Umar ibn al-Khattab radi Allahu anhu, after consulting with the Companions, fixed the punishment for the drinker at eighty lashes. The statement of Sayyiduna Ali radi Allahu anhu «كُلٌّسُنَّةٌ» supports the fact that both forty and eighty are correct and Sunnah, and furthermore, the ruler of the time has the authority to, at his discretion, administer whatever punishment he deems appropriate to the drinker—forty lashes or eighty lashes.