The invention discloses a p-type doped ZnO-based diluted magnetic semiconductor material and the preparation method. The material molecular structure formula is ZnTMyxO, in which Tm represents transition metal element, Co, Ni, Mn and other elements, x=0-10%, y=0-20%. Method is that zinc acetate, sodium acetate and transition metal salt are dissolved in ethylene glycol monomethyl ether as precursor; then ethanol is added as stabilizer; after stirring, the stable sol is formed. After the sol being dried and heat treated, the power sample is obtained; or by spin coating, the sol is coated uniformly on the Si wafer cleaned in advance or other substrates (quartz glass, sapphire, SiC and other materials), after being dried and heat treated, the thin film sample is obtained. The sol-gel method of preparing material has the advantage of simple technology, low cost, and obtaining easily large area thin films; based on the preparation of the room-temperature ferromagnetic ZnO-based diluted magnetic semiconductor, the Na ion is introduced successfully to obtain the p-type doping; therefore the magnetic property is improved, and by regulating concentration of the Na ion, the magnetic property is controlled.