DC microgrids have promising applications in renewable integration due to their better energy efficiency when connecting DC components. However, they might be unstable since many loads in a DC microgrid are regulated as constant power loads (CPLs) that have a destabilizing negative impedance effect. As a result, the state trajectory displacement caused by abrupt load changes or contingencies can easily lead to instability. Many existing works have been devoted to studying the region of attraction (ROA) of a DC microgrid, in which the system is guaranteed to be asymptotically stable. Nevertheless, existing work either focuses on using numerical methods for ROA approximations that generally have no performance guarantees or cannot ensure a desired ROA for a general DC microgrid. To close this gap, this paper develops an innovative control synthesis algorithm to make a general DC microgrid have a theoretically guaranteed ROA, for example, to cover the entirety of its operating range regarding state trajectories. We first study the nonlinear dynamics of a DC microgrid to derive a novel transient stability condition to rigorously certify whether a given operating range is a subset of the ROA; then, we formulate a control synthesis optimization problem to guarantee the condition's satisfaction. This condition is a linear constraint, and the optimization problem resembles an optimal power flow problem and has a good computational behavior. Simulation case studies verify the validity of the proposed work.