Electronic structure of chalcopyrite-type CuAlS2 is analyzed from the band structure and the density of states. Compared with bulk CuAlS2, the effect of doping with Mg and Zn are investigated from the crystal structure, band structure, density of states and electron density difference. The results reveal that Mg and Zn substituting Al both increase the lattice constants and cell volume, yield acceptor states on the top of valence band, providing p-type conductance. CuAlS2 ∶Zn has a slightly larger ionization energy than CuAlS2 ∶Mg, while the former has lower total energy and its crystal structure is more stable.