The thermal radiation from an isolated finite-length carbon nanotube (CNT) is theoretically investigated both in near- and far-field zones. The formation of the discrete spectrum in metallic CNTs in the terahertz range is demonstrated due to the reflection of strongly slowed-down surface-plasmon modes from CNT ends. The effect does not appear in semiconductor CNTs. The concept of CNT as a thermal nanoantenna is proposed.