Four kinds of magic-size CdS clusters and two different regular CdS quantum dots have been studied by x-ray total scattering technique and pair distribution function method. Results for the regular CdS quantum dots could be modelled as a mixed phase of atomic structures based on the two bulk crystalline phases, which is interpreted as representing the effects of stacking disorder. However, the results for the magic-size clusters were significantly different. On one hand, the short-range features in the pair distribution function reflect the bulk, indicating that these structures are based on the same tetrahedral coordination found in the bulk phases (and therefore excluding new types of structures such as cage-like arrangements of atoms). But on the other hand, the longer- range atomic structure clearly does not reflect the layer structures found in the bulk and the regular quantum dots. We compare the effects of two ligands, phenylacetic acid and oleic acid, showing that in two cases the ligand has little effect on the atomic structure of the magic-size nanocluster and in another it has a significant effect