A systematic investigation has been performed to elucidate effects of Rare-Earth (RE) type and local atomic configuration on magnetic properties of icosahedral quasicrystal (iQC) and their cubic approximants (2/1 and 1/1 ACs) in the ternary Cd-Mg-RE (RE = Gd, Tb, Dy, Ho, Er, and Tm) systems. At low temperatures, iQC and 2/1 ACs exhibit spin-glass-like freezing for RE = Gd, Tb, Dy, and Ho, while Er and Tm systems do not show freezing behaviour down to the base temperature ~ 2 K. The 1/1 ACs exhibit either spin-glass-like freezing or antiferromagnetic (AFM) ordering depending on their constituent Mg content. The Tf values show increasing trend from iQC to 2/1 and 1/1 ACs. In contrast, the absolute values of Weiss temperature for iQCs are larger than those in 2/1 and 1/1 ACs, indicating that the total AFM interactions between the neighboring spins are larger in aperiodic, rather than periodic systems. Competing spin interactions originating from the long-range Ruderman-Kittel-Kasuya-Yoshida mechanism along with chemical disorder of Cd/Mg ions presumably account for the observed spin-glass-like behavior in Cd-Mg-RE iQCs and ACs.