The free longitudinal vibration analysis of nanorods (carbon nanotubes) with arbitrary boundaries is presented via a hardening nonlocal approach. Stokes' transformation incorporated with Fourier sine series is employed for the simulation of nanorod deformation. The Fourier coefficients for nanorods having ends with axial restraints are obtained by the substitution of a deformation function and its derivatives into the governing equation. The explicit expressions are derived for the angular frequencies by using nonlocal boundary conditions in terms of nondimensional parameters. A detailed parametric investigation has been carried out to study the effects of the nonlocal and spring parameters on the size-dependent vibration characteristics of the nanorods. The main objective of this study is to present a general analytical approach for the dynamical analysis of nanorods (carbon nanotubes) with arbitrary boundary conditions (restrained or rigid).