A scheme to generate a flat optical frequency comb (OFC) is proposed and experimentally demonstrated based on a directly modulated distributed feedback (DFB) laser cascaded with a polarization modulator (PolM). In the proposed scheme, the DFB laser is optically injection-locked by a tunable laser source and directly modulated by a radio frequency (RF) signal, which is amplified by a microwave power amplifier. The optical signal is then sent to PolM via a polarization controller (PC) and modulated by the amplified and phase-shifted RF signal from the same source. The optical signal is finally received and measured by an optical spectrum analyzer (OSA) after transmitting through another PC and a polarizer. Here, the OFC with their power variation within 3 dB is desired, and four OFCs with 6, 6, 5, and 4 comb lines are generated using the RF signals with different frequencies, which have a flatness of, respectively, 2.4, 2.5, 0.7, and 0.6 dB. Here, the number of comb lines is decreased, which is due to the RF signal power decrease while its frequency is raised.