The invention relates to an imidazoline corrosion inhibitor, a synthetic method and application thereof, and is applicable to boiler anticorrosion in natural gas processing plant. The imidazoline corrosion inhibitor comprises main agent of rosin, and additives of bis(beta-aminoethyl) amineand N,N-dimethyl acetamide. In addition, on the basis of synthesis of imidazoline corrosion inhibitor, guanyl with closing-opening performance under the action of CO2 / N2 is introduced, so as to on the one hand improve the corrosion inhibition performance of on CO2, and on the other hand recycle the inhibitor. Finally, under simulated field conditions, when the dosage of the corrosion inhibitor is at 400 mg/L, the inhibition rate reaches 80%, and the corrosion rate and corrosion inhibition efficiency are good. The corrosion inhibitor mainly inhibits the cathodic hydrogen evolution reduction reaction as well as anodic metal dissolution effect, and belongs to a mixed type corrosion inhibitor focusing on anodic inhibition. The corrosion inhibitor provided by the invention has the advantages of low cost, simple and efficient usage mode, low toxicity, no stimulation, no odor and reduction of pollution on water and environment.