A twisted curve in the Euclidean 3-space E^3 is called a rectifying curve if its position vector field always lie in its rectifying plane. In this article we study geodesics on an arbitrary cone in E^3, not necessary a circular one, via rectifying curves. Our main result states that a curve on a cone in E^3 is a geodesic if and only if it is either a rectifying curve or an open portion of a ruling. As an application we show that the only planar geodesics in a cone in E^3 are portions of rulings.