We calculate the B-meson decay constants f_B, f_Bs, and their ratio in unquenched lattice QCD using domain-wall light quarks and relativistic b-quarks. We use gauge-field ensembles generated by the RBC and UKQCD collaborations using the domain-wall fermion action and Iwasaki gauge action with three flavors of light dynamical quarks. We analyze data at two lattice spacings of a ~ 0.11, 0.086 fm with unitary pion masses as light as M_pi ~ 290 MeV; this enables us to control the extrapolation to the physical light-quark masses and continuum. For the b-quarks we use the anisotropic clover action with the relativistic heavy-quark interpretation, such that discretization errors from the heavy-quark action are of the same size as from the light-quark sector. We renormalize the lattice heavy-light axial-vector current using a mostly nonperturbative method in which we compute the bulk of the matching factor nonperturbatively, with a small correction, that is close to unity, in lattice perturbation theory. We also improve the lattice heavy-light current through O(alpha_s a). We extrapolate our results to the physical light-quark masses and continuum using SU(2) heavy-meson chiral perturbation theory, and provide a complete systematic error budget. We obtain f_B0 = 199.5(12.6) MeV, f_B+ = 195.6(14.9) MeV, f_Bs = 235.4(12.2) MeV, f_Bs/f_B0 = 1.197(50), and f_Bs/f_B+ = 1.223(71), where the errors are statistical and total systematic added in quadrature. These results are in good agreement with other published results and provide an important independent cross check of other three-flavor determinations of $B$-meson decay constants using staggered light quarks.