This paper proposes a novel distributed control strategy for DC microgrids using a convex relaxation method to ensure the system operates at the optimal power flow solution. Initially, a suitable convex relaxation technique is applied to transform the non-convex optimal power flow problem into a convex form, with the accuracy of this method being rigorously demonstrated. Next, the Karush–Kuhn–Tucker (KKT) optimality conditions of the relaxed problem are equivalently transformed, and a synchronization term is derived to facilitate the distributed control, thereby ensuring operation under optimal power flow. This paper also analyzes the impacts of communication delay and network structure on the performance of the proposed control strategy. Finally, simulations and numerical experiments are presented to validate the effectiveness of the proposed method.