The rotational dynamics of carbon monoxide (CO) in a molten salt, ionic liquids (ILs), and alkanes were investigated by (17)O NMR T1 measurements using labeled C(17)O. The molten salt and the studied ILs have the bis(trifluoromethanesulfonyl)imide anion ([NTf2](-)) in common. In hexane near room temperature, the rotational relaxation times are close to the values predicted from the slip boundary condition in the Stokes-Einstein-Debye (SED) theory. However, in contradiction to the theoretical prediction, the rotational relaxation times decrease as the value of η/T increases, where η and T are the viscosity and absolute temperature, respectively. In other alkanes and ILs used in this study, the rotational relaxation times are much faster than those predicted by SED, and show a unique dependence on the number of alkyl carbons. For the same value of η/T, the CO rotational relaxation times in ILs composed of short-alkyl-chain-length imidazolium cations (1-ethyl-3-methylimidazolium and 1-butyl-3-methylimidazolium) are close to those for a molten salt (Cs[NTf2]). On the other hand, the rotational relaxation times in ILs composed of long-chain-length imidazolium (1-methyl-3-octylimidazolium) and phosphonium (tributylmethylphosphonium and tetraoctylphosphonium) cations are much shorter than the SED predictions. This deviation from theory increases as the alkyl chain length increases. We also found that the rotational relaxation times in dodecane and squalane are similar to those in ILs with a similar number of alkyl carbons. These results are discussed in terms of heterogeneous solvation and in comparison with the translational diffusion of CO in ILs.