Droop-controlled distributed energy resource converters in dc microgrids usually show low output impedances. When coupled with ac systems, second-order harmonics typically appear on the dc-bus voltage, causing significant harmonic currents at the converters resource side. This paper shows how to reduce such undesired currents by means of notch filters and resonant regulators included in the converters control loops. The main characteristics of these techniques in terms of harmonic attenuation and stability are systematically investigated. In particular, it is shown that the voltage control-loop bandwidth is limited to be below twice the line frequency to avoid instability. Then, a modified notch filter and a modified resonant regulator are proposed, allowing to remove the constraint on the voltage loop bandwidth. The resulting methods (i.e., the notch filter, the resonant regulator, and their corresponding modified versions) are evaluated in terms of output impedance and stability. Experimental results from a dc microgrid prototype composed of three dc-dc converters and one dc-ac converter, all with a rated power of 5 kW, are reported.