The effect of thermal stresses on the torsional vibration of non, single, and double-cracked nanorods surrounded by an elastic medium is investigated. The differential constitutive relation of the nonlocal theory is applied to the motion equation. Three-dimensional linear thermal strains raised from the thermal stresses are derived using nonlinear Green's strains. The surrounding elastic medium acts as infinite torsional springs. The crack is modeled as a rotational spring. Using Hamilton's principle, the motion equation is obtained. Effect of the crack position and severity, number of cracks, high and low temperatures, nonlocal coefficient, elastic medium stiffness, and nanorod length are examined. The temperature effect on the frequencies depends on the values of the crack parameters, crack numbers, elastic medium stiffness, and nanorod length, and it is independent of the nonlocal scale coefficient. The crack leads to a decrease in the frequencies at any temperature. The elastic medium causes an increase in the frequencies at any temperature.