The invention relates to a phosphorus-containing fire retardant, a preparation method of the phosphorus-containing fire retardant and a flame-retardant epoxy resin prepared from the phosphorus-containing fire retardant, and especially relates to a phosphorus-containing nitrile/DOPO double-base structure phosphorus-containing fire retardant, a preparation method of the phosphorus-containing nitrile/DOPO double-base structure phosphorus-containing fire retardant, and flame-retardant epoxy resin prepared from the phosphorus-containing nitrile/DOPO double-base structure phosphorus-containing fire retardant. The flame-retardant epoxy resin solves the problem that the existing epoxy resin has low flame retardation efficiency and poor compatibility between a polymer matrix and a fire retardant. The preparation method comprises the following steps of 1, dissolving p-hydroxybenzaldehyde and tetrahydrofuran, adding triethylamine into the solution and carrying out stirring, 2, dissolving phosphonitrilic chloride trimer in tetrahydrofuran, dropwisely adding the solution into the reaction system, and carrying out heating and stirring, 3, cooling the reaction system, concentrating the filtrate, pouring the filtrate into water for precipitate separation, carrying out pumping filtration, carrying out recrystallization on the precipitates and carrying out drying to obtain intermediates, and 4, dissolving the intermediates by a solvent, adding p-aminophenol into the solution, carrying out heating reflux, adding DOPO into the reflux product, carrying out condensation, pouring the concentrate into cold ethanol for solid precipitation, and washing and drying the solids to obtain the phosphorus-containing nitrile/DOPO double-base structure phosphorus-containing fire retardant. The flame-retardant epoxy resin comprises epoxy resin, a curing agent and the phosphorus-containing nitrile/DOPO double-base structure phosphorus-containing fire retardant. The preparation method is used for preparing the phosphorus-containing nitrile/DOPO double-base structure phosphorus-containing fire retardant.