We report the relative frequency stabilization of a distributed feedback erbium-doped fiber laser on an optical cavity by serrodyne frequency shifting. A correction bandwidth of 2.3 MHz and a dynamic range of 220 MHz are achieved, which leads to a strong robustness against large disturbances up to high frequencies. We demonstrate that serrodyne frequency shifting reaches a higher correction bandwidth and lower relative frequency noise level compared to a standard acousto-optical modulator based scheme. Our results allow to consider promising applications in the absolute frequency stabilization of lasers on optical cavities.