The ab initio computer design of the CdS-based quantum dots and the cobalt doped CdS quantum dots is carried out. The characteristics features of the atomic and electronic structures of semiconductor colloidal quantum dots on CdS of different sizes are studied, and the effect of cobalt impurity atoms is estimated. We have proved the sensitivity of the X-ray absorption near-edge structure (XANES) method for the verification of the nanosized atomic structural parameters calculated by the methods of computer modeling for small-scale quantum dots of the CdS family, and for the determination of the local environment parameters of the cobalt atom in the quantum dot.