In this article, we propose a novel four-stage distributed controller for a dc microgrid that achieves proportional power sharing and average voltage regulation for the voltages at actuated and unactuated buses. The controller is presented for a dc microgrid comprising multiple distributed generation units (DGUs) with time-varying actuation states, dynamic RLC lines, nonlinear constant impedance, current, and power (ZIP) loads, and a time-varying network topology. The controller comprising a nonlinear gain, proportional-integral (PI) controllers, and two dynamic distributed averaging stages is designed for asymptotic stability. This constitutes deriving passivity properties for the dc microgrid, along with each of the controller subsystems. Thereafter, design parameters are found through a passivity-based optimization using the worst-case subsystem properties. The resulting closed loop is robust against DGU actuation changes, network topology changes, and microgrid parameter changes. The stability and robustness of the proposed control are verified via simulations.