The geometry structure, band structure, partial density of states, mulliken changes, and electron density of zinc blende CdS and CdS:M(M=Mg, Cu) were studied systemically by the density functional theory(DFT) based on first-principles pseudopotential caculation. It is shown that the M-doped material has a smaller lattice constant, which results in a local lattice distortion. The band structure and density of states(DOS) were further calculated and analysed in detail. The results show that Cds doped with Mg, Cu can provid many states of holes. The p-type conduction was obtained. And Cu was a better p-type dopant than Mg.