In counting degrees of freedom of a linear molecule, why is rotation about the axis not counted? I was reading about the equipartition theorem and I got the following quotations from my books:

A diatomic molecule like oxygen can rotate about two different axes. But rotation about the axis down the length of the molecule doesn't count. - Daniel V. Schröder's Thermal Physics.
A diatomic molecule can rotate like a top only about axes perpendicular to the line connecting the atoms but not about that line itself. - Resnick, Halliday, Walker s' Fundamentals of Physics.

Why is it so? Doesn't the rotation take place that way?
 A: The energy levels of a diatomic molecule are $E = 2B, 6B, 12B$ and so on, where $B$ is:
$$ B = \frac{\hbar^2}{2I} $$
Most of the mass of the molecule is in the nuclei, so when calculating the moment of inertia $I$ we can ignore the electrons and just use the nuclei. But the size of the nuclei is around $10^{-5}$ times smaller than the bond length. This means the moment of inertia around an axis along the bond is going to be about $10^{10}$ smaller than the moment of inertia around an axis normal to the bond. Therefore the energy level spacings will be around $10^{10}$ times bigger along the bond than normal to it.
In principle we can still excite rotations about the axis along the bond, but you'd need huge energies to do it.
A: Just an addition to John Rennie's answer. The equipartition theorem can only be derived in classical statistical physics. In quantum statistics it is not correct. For each degree of freedom there is a characteristic temperature below which the quantum effects are significant. This temperature is very high for rotation around the axis of the molecule; I guess it is much higher than the temperature at which the molecule dissociates, so this degree of freedom is "frozen" as long as the molecule exists and can be ignored.
