In dc microgrids, load power sharing and bus voltage regulation are two common control objectives. In this article, a consensus-based algorithm is presented to achieve proportional power sharing and regulation of weighted geometric mean of bus voltages in dc microgrids with ZIP (constant impedance, constant current, and constant power) loads simultaneously. By using the virtue of the Laplacian matrices of undirected connected graphs, a lemma is derived to assist the stability analysis of the dc microgrids. Thus, a sufficient condition that stabilizes the system with ZIP loads is established. In addition, with the help of a distributed voltage regulation error estimator, the tuning of the bus voltages can be realized without the requirement on initial voltage conditions. Through the Lyapunov synthesis, the large-signal stability of the closed-loop system is theoretically ensured for a wide range of load conditions. Finally, simulation studies are performed to validate the merits of the proposed consensus-based algorithm. A Consensus-Based Algorithm for Power Sharing and Voltage Regulation in DC Microgrids