The invention discloses a metal surface rust inhibitor and a preparation method thereof. The metal surface rust inhibitor comprises dodecenylsuccinic acid, benzotriazole, zinc naphthenate, N-ethyl-N-phenyl zinc dithiocarbamate, sodium oleate, ethylene glycol, inositol hexaphosphate, aluminium powder, barium sulfate, hydroxy propyl methyl cellulose, dimethylaminoethyl acrylate, sodium allysulfonate and water. The preparation method comprises the following steps: adding dodecenylsuccinic acid, benzotriazole and zinc naphthenate into water, stirring the mixture I uniformly, adding N-ethyl-N-phenyl zinc dithiocarbamate, sodium oleate, ethylene glycol, inositol hexaphosphate, aluminium powder, barium sulfate into the mixture I, adding hydroxy propyl methyl cellulose, dimethylaminoethyl acrylate and sodium allysulfonate into the mixture II, and adding rest components into the mixture III to obtain the rust inhibitor. The rust inhibitor provided by the invention can increase the corrosion resistance of a metal surface and improve the moist isolating property and the air isolating property of a protective layer.