The use of carbon nanotubes as optical probes for scanning near-field optical microscopy requires an understanding of their near-field response. As a first step in this direction, we investigated the lateral resolution of a carbon nanotube tip with respect to an ideal electric dipole representing an elementary detected object. A Fredholm integral equation of the first kind was formulated for the surface electric current density induced on a single-wall carbon nanotube (SWNT) by the electromagnetic field due to an arbitrarily oriented electric dipole located outside the SWNT. The response of the SWNT to the near field of a source electric dipole can be classified into two types, because surface-wave propagation occurs with (i) low damping at frequencies less than ~ 200-250 THz and (ii) high damping at higher frequencies. The interaction between the source electric dipole and the SWNT depends critically on their relative location and relative orientation, and shows evidence of the geometrical resonances of the SWNT in the low-frequency regime. These resonances disappear when the relaxation time of the SWNT is sufficiently low. The far-field radiation intensity is much higher when the source electric dipole is placed near an edge of SWNT than at the centroid of the SWNT. The use of an SWNT tip in scattering-type scanning near-field optical microscopy can deliver a resolution less than ~ 20 nm. Moreover, our study shows that the relative orientation and distance between the SWNT and the nanoscale dipole source can be detected.