According to the anti-corrosion coating, the heat exchanger applying the anti-corrosion coating and the coating method, the surface of the heat exchanger is coated with the nanometer hydrophobic coating, organic-inorganic hybrid organic silicon serves as a main component, the main chain of the organic-inorganic hybrid organic silicon is an inorganic Si-O-Si chain segment, the anti-corrosion performance is better than that of organic silicon, Si-OH and the surface of a metal base material can easily form a Si-O-Me bond, and therefore the anti-corrosion performance of the heat exchanger is improved. Therefore, the adhesive force between the coating and the metal base material can be enhanced; the branched chain is a hydrophobic organic chain segment, so that the hydrophobic organic chain segment has good hydrophobicity. On one hand, the overall uniformity of the coating is guaranteed, and on the other hand, the production process is simplified. The coating is an organic-inorganic hybrid coating and is subjected to hydrophobic functionalization or added with a hydrophobic coating, so that the coating has better corrosion resistance, the scaling period is delayed, and the heat exchange performance of the heat exchanger in long-term use is ensured. During production, the heat exchanger only needs to be immersed in the coating, so that the production efficiency is improved, the manufacturing cost is reduced, and the production period is shortened.