Addition of inhibitor is an efficient and feasible method to delay the corrosion of magnesium alloys. Longan residue extract (LRE) is a promising inhibitor with the sustainable and abundant advantages. However, the inhibition efficiency of LRE is only 80.01% in NaCl solution, which would not supply the efficient protection for the Mg alloys. The other inhibitor, sodium dodecylbenzenesulfonate (SDBS), is employed to refine the anti-corrosion performance. The anti-corrosion performance of hybrid inhibitor is investigated by electrochemical measurements, scanning electron microscopy (SEM), X-ray diffractometer (XRD), and atomic force microscopy (AFM). The inhibition efficiency can be remarkably increased to 92.15% due to the synergistic effects of LRE and SDBS. The anti-corrosion performance would be further increased to 95.67% if the Mg alloys are soaked in the solution including the hybrid inhibitors for 12 h. The present studies explore a new and efficient inhibitor for Mg alloys and afford a feasible strategy to utilise the agriculture waste.