In the presence of the [Cp*IrCl2]2/NaOH system, the direct N-alkylation of 2-aminoquinazolines and 2-aminopyrimidines with alcohols afforded the N-exosubstituted 2-(N-alkylamino)quinazolines and 2-(N-alkylamino)pyrimidines with 71–96% yields and complete regioselectivities. The protocol is highly attractive because of easily available starting materials, high atom efficiency and environmental friendliness