Using first-principles calculations, we propose a two-dimensional diluted magnetic semiconductor: monolayer MoS2 doped by transition metals. Doping of transition metal atoms from the IIIB to VIB groups results in nonmagnetic states, since the number of valence electrons is smaller or equal to that of Mo. Doping of atoms from the VIIB to IIB groups becomes energetically less and less favorable. Magnetism is observed for Mn, Fe, Co, Zn, Cd, and Hg doping, while for the other dopants from these groups it is suppressed by Jahn-Teller distortions. Analysis of the binding energies and magnetic properties indicates that (Mo,X)S2 (X=Mn, Fe, Co, and Zn) are promising systems to explore two-dimensional diluted magnetic semiconductors.