In this experiment, terephthalyl alcohol was used as a modifier to modify phenol under both acidic and alkaline conditions to obtain modified phenols with different molecular structures. Subsequently, the modified phenols reacted with paraformaldehyde in an alkaline environment. After foaming and curing, a modified phenolic foam with high heat aging resistance was obtained. The molecular structure was characterized via Fourier transform infrared spectrometry (FT-IR) and nuclear magnetic resonance spectroscopy (13C NMR). The results showed that two different structures of phenolic resin can be successfully prepared under different conditions of acid and alkali. The modified phenolic foam was tested by thermogravimetric analysis. In addition, the modified phenolic foam was tested for mass change rate, dimensional change rate, powdering rate, water absorption rate, and compressive strength before and after aging. The results show that the modified phenolic foam has excellent performance. After heat aging for 24 h, the mass loss rate of the modified phenolic foam obtained by acid catalysis was as low as 4.5%, the pulverization rate was only increased by 3.2%, and the water absorption of the modified phenolic foam increased by 0.77%, which is one-third that of the phenolic foam. Compared with the phenolic foam, the modified phenolic foam shows good heat aging resistance.