In current work, novel functionalized carbon dots have been designed and synthesized by covalently linking dopamine to the surface of S,N co-doped carbon dots (DA-S,N-CDs) for the selective detection of Fe3+ and Fe2+ in water. The as-synthesized DA-S,N-CDs emit blue fluorescence peaked at 470 nm and exhibit excitation-dependent tunable emissions. The tolerance towards pH, salt, and UV irradiation of synthesized carbon dots reveals excellent stability. Upon exposure to Fe3+ or Fe2+, the fluorescence of DA-S,N-CDs was selectively quenched, while other competitive cations did not change significantly. Under the optimal experimental conditions, the fluorescence intensity of DA-S,N-CDs showed a good linear relationship with the concentrations of Fe3+ and Fe2+ (5 - 200 μM for Fe3+ and 5 - 300 μM for Fe2+), and the limit of detection was 2.86 and 2.06 μM, respectively. Furthermore, considering the excellent stability and anti-interference, DA-S,N-CDs have been successfully used for the detection of Fe3+ and Fe2+ in environmental water.