The formation of CdS and CoS_2 nanoparticles along the DNA strands have been studied. The systems DNA-Cdl_2 and DNA-CoCl_2 have been investigated in the solid state in order to form DNA-MX_2 complex salts used as precursors. They react with S^(2-)ions giving birth to CdS and CoS_2 nanoparticles. A model describing the DNA-nanosulphide association is proposed.