In this paper, inspired by the concept of virtual inertia in alternating current (AC) systems, a virtual impedance controller is proposed for dynamic improvement of direct current (DC) microgrids. A simple and inexpensive method for inertia injection to the system is used to adjust the output power of each distributed generation unit without using additional equipment. The proposed control scheme consists of two components: a virtual capacitance and a virtual inductance. These virtual components can change the rate of change of DC bus voltage and also improves the transient response. A small-signal analysis is carried out to verify the impact of proposed control strategy. Numerical simulation studies validate effectiveness of the proposed solution in increasing the inertia of DC microgrids.