In this research, a novel method is proposed to improve DNA straightening under an applied electric field to facilitate imaging in a liquid phase by modifying the substrate with varying Mg2+ ion concentrations. A two-dimensional network of DNA structures was successfully stretched on Mg2+-modified mica substrates under a DC electric field (1 V, 1 A) and imaged in gaseous and aqueous phases by atomic force microscopy. The results revealed that an optimum concentration of Mg2+ ion (4.17 μmol/ml) allowed DNA straightening under an electric field, thus facilitating its imaging in the liquid phase. Furthermore, DNA adhesion under different concentrations of Mg2+ was measured and a maximum adhesion force of 76.19 pN was achieved. This vital work has great potential in gene knockout and targeted gene editing.